Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

handling picture within a frame

Posted on 2004-11-01
7
Medium Priority
?
191 Views
Last Modified: 2010-03-31
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
0
Comment
Question by:kimo100
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 9

Expert Comment

by:DrWarezz
ID: 12464885
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]
0
 
LVL 9

Expert Comment

by:DrWarezz
ID: 12464898
hmmm....

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

[r.D]
0
 
LVL 24

Accepted Solution

by:
sciuriware earned 200 total points
ID: 12465712
You can add the picture to the radiobutton, by  .setIcon(Icon) or by creating the RadioButton(Icon),
ans set it in front by .setHorizontalAlignment(SwingConstants.*);
;JOOP!
0
 
LVL 9

Expert Comment

by:DrWarezz
ID: 12791903
Hi V,
to save you the decission; award sciuriware with the points, please. :-)

[r.D]
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 12791915
I'm honoured.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question