The Artima Developer Community
Sponsored Link

Java Answers Forum
Making radio buttons work

1 reply on 1 page. Most recent reply: Jun 16, 2002 10:06 PM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
jake

Posts: 83
Nickname: onorok
Registered: May, 2002

Making radio buttons work Posted: Jun 12, 2002 5:19 PM
Reply to this message Reply
Advertisement
What does it mean when you, add an "action command to each JRadioButton? I normaly just hard code the value in the event for each button.


Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: Making radio buttons work Posted: Jun 16, 2002 10:06 PM
Reply to this message Reply
With JRadioButton you have several constructors to choose from:


Constructor Summary

JRadioButton()
Creates an initially unselected radio button with no set text.

JRadioButton(Action a)
Creates a radiobutton where properties are taken from the Action supplied.

JRadioButton(Icon icon)
Creates an initially unselected radio button with the specified image but no text.

JRadioButton(Icon icon, boolean selected)
Creates a radio button with the specified image and selection state, but no text.

JRadioButton(String text)
Creates an unselected radio button with the specified text.

JRadioButton(String text, boolean selected)
Creates a radio button with the specified text and selection state.

JRadioButton(String text, Icon icon)
Creates a radio button that has the specified text and image, and that is initially unselected.

JRadioButton(String text, Icon icon, boolean selected)
Creates a radio button that has the specified text, image, and selection state.



So you can use an Action, Icon, or a String object, provided you handle it correctly.

Flat View: This topic has 1 reply on 1 page
Topic: Minimise frame Previous Topic   Next Topic Topic: java to lotus notes

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use