File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes RadioButtons and if statements and more.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "RadioButtons and if statements and more.... " Watch "RadioButtons and if statements and more.... " New topic

RadioButtons and if statements and more....

Justin Kuyken

Joined: Aug 26, 2004
Posts: 4
I am creating a program for school and was wondering if someone could help me in figuring out how i could add a section to my program where if the user selects a specific radio button in the group that a JList and a Jbutton appear in the container with everything else and if that radio button is no longer selected the list and button disapear again.
I've tried playing around with ItemListeners and flags but to no luck...
If possibly please explain in simple terms as i am not really up with the technical phrases thanks,
Any help would be greatly appreceated.
[ September 07, 2004: Message edited by: Justin Kuyken ]
Ilja Preuss

Joined: Jul 11, 2001
Posts: 14112
I think an ActionListener on the radio button should work.

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Max Rahder
Ranch Hand

Joined: Nov 06, 2000
Posts: 177
Read the Swing Tutorial. It's great.

Here's a crude example:
I agree. Here's the link:
subject: RadioButtons and if statements and more....
It's not a secret anymore!