Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RadioButtons and if statements and more....

 
Justin Kuyken
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think an ActionListener on the radio button should work.
 
Max Rahder
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the Swing Tutorial. It's great. http://java.sun.com/docs/books/tutorial/uiswing/

Here's a crude example:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic