A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
Swing / AWT / SWT
Changing background images
Joined: Jan 05, 2009
Jan 13, 2009 04:01:25
I am new to Swing. I am preparing a application in which i am displaying a image in panel. I want to add a functionality in which if i click on that image then background image change.
How can i do that .Please help.
Thanks in advance
Joined: Jul 26, 2007
Jan 13, 2009 04:26:21
In case you haven't done so, check out this example on displaying background images
So when you want to change the image,
1) assign the new image to the image instance
2) Call a revalidate and repaint on the panel so it will start displaying the new image.
Donate a pint, save a life!
How to ask questions
Onff-turn it on!
I agree. Here's the link:
- it saves me about five hours per week
subject: Changing background images
Multiple Panels Background Image
dimension not perfect
transparent components..challenging task
window print problem
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013