Results 1 to 3 of 3
Thread: How to swap to images on clicks
- 12-03-2009, 02:16 AM #1
How to swap to images on clicks
I have to images; 1.jpg and 2.jpg of the same size. Now i want to swap between the two images any time user clicks on it like a toggle.
How do i do this in NetBeans 6.7.1 JFrame form?
I tries using the JToggleButton but didn't work .
thanksLife is not perfect, but the way you live it can make it perfectly wongerful :cool:
- 12-03-2009, 04:00 AM #2Senior Member
- Join Date
- Jul 2009
- Rep Power
Use the setIcon(...) method to change the icon on every mousePressed event.
- 12-03-2009, 09:13 PM #3
- By marodia in forum AWT / SwingReplies: 1Last Post: 08-25-2009, 10:11 AM
- By carderne in forum New To JavaReplies: 6Last Post: 02-28-2009, 08:10 PM
- By illidian in forum Advanced JavaReplies: 1Last Post: 04-04-2008, 09:49 PM
- By Sveta_cool in forum Advanced JavaReplies: 2Last Post: 02-01-2008, 03:55 PM
- By mary in forum Advanced JavaReplies: 1Last Post: 08-02-2007, 06:32 PM