Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Image Refresh/Change in JLabel

843805Feb 18 2007 — edited Apr 30 2008
Hi, i've created a Image in a label using
 
	image = new ImageIcon("logo.jpg");
	pnllogo = new JLabel(image);
	pnllogo.setBounds(0, 0, 287, 77);
	loginGUI.getContentPane().add(pnllogo);
loginGUI is the frame, and pnlLogo is the Label with the picture.. If i wanted to change the picture in that label lets say on the click of a button what would I need to do...

I tried changing the location of the logo in image to the new picture but in theory that doesn't do noting, if correct I need to update the whole pnllogo or the Frame..? how would I go about it.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2008
Added on Feb 18 2007
9 comments
1,527 views