Link to home
Start Free TrialLog in
Avatar of kimo100
kimo100

asked on

handling picture within a frame

how can i show and hide a picture(like a tringle which contain an exclamation mark)
in a frame which contains a group of radiobutton at selecting
one of these radiobutton.
the symbol must be shown in front of the radiobutton.

thanks
Avatar of DrWarezz
DrWarezz

Use a JLabel to add the image to the screen, OR a JButton, here's an example:


ImageIcon imgIc = new ImageIcon( "image.gif" );
JButton jb = new JButton( imgIc );
jb.setSize( x, y );
jb.setBorderPainted( false );

Then, when they select the radiobutton, it gets the image name from an array, and uses this to replace it:

imgIc = new ImageIcon( "NewImage.gif" );
jb = new JButton( imgIc );

repaint();

I think that should do it -- what do you think?? :-)
[r.D]
hmmm....

>"the symbol must be shown in front of the radiobutton."
...what do you mean by this exactly? :o\

[r.D]
ASKER CERTIFIED SOLUTION
Avatar of sciuriware
sciuriware

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi V,
to save you the decission; award sciuriware with the points, please. :-)

[r.D]
I'm honoured.