Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Display Multiple icons on a single JButton after each click

Reply
Thread Tools

Display Multiple icons on a single JButton after each click

 
 
arash470@googlemail.com
Guest
Posts: n/a
 
      02-14-2007
Hi all..

I have a problem with JButtons in Java Swing!!

How do u add more than one icons ( like 10 icons) in a single button,
and when we keep clicking the button it displays the different icons
one after the other and starts repeating the icons again after
completing the gifs...

If any one of you could actually write a sample code for me i would be
greatful.. i have been going crazy over this..

Thanks for your help in advance.

ARS

 
Reply With Quote
 
 
 
 
hiwa
Guest
Posts: n/a
 
      02-14-2007
On Feb 14, 3:20 pm, arash...@googlemail.com wrote:
> Hi all..
>
> I have a problem with JButtons in Java Swing!!
>
> How do u add more than one icons ( like 10 icons) in a single button,
> and when we keep clicking the button it displays the different icons
> one after the other and starts repeating the icons again after
> completing the gifs...
>
> If any one of you could actually write a sample code for me i would be
> greatful.. i have been going crazy over this..
>
> Thanks for your help in advance.
>
> ARS


Make a single Image from your original ten Images and make an
ImageIcon from the resultant Image. --(a)

Repeat (a) choosing randomly from your original Images stock, in the
action listener of the button.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SIngle-click on JButton registers multiple times - why? Todd Java 5 08-23-2007 10:05 AM
why my applet can't display components like JButton or JTextField, but JLabel is well feofao@gmail.com Java 5 12-26-2005 02:24 AM
return a String on click of a JButton Allan Bruce Java 3 06-15-2004 05:01 PM
JButton auto click patrick Java 1 04-02-2004 05:21 PM
How to display the texts into 2 line in JButton? James Java 2 11-11-2003 10:08 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57