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
Hi all,
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 #2
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,236
- Rep Power
- 13
Use the setIcon(...) method to change the icon on every mousePressed event.
- 12-03-2009, 09:13 PM #3
Similar Threads
-
swap two frames on user click
By marodia in forum AWT / SwingReplies: 1Last Post: 08-25-2009, 10:11 AM -
[SOLVED] Intercepting mouse clicks
By carderne in forum New To JavaReplies: 6Last Post: 02-28-2009, 08:10 PM -
Question about CAS (compare and swap) method
By illidian in forum Advanced JavaReplies: 1Last Post: 04-04-2008, 09:49 PM -
code for number of clicks clicked on a web page???
By Sveta_cool in forum Advanced JavaReplies: 2Last Post: 02-01-2008, 03:55 PM -
how to swap 2 numbers
By mary in forum Advanced JavaReplies: 1Last Post: 08-02-2007, 06:32 PM
Bookmarks