Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Values of Check and Combo Boxes

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
Hello, I know I can get the value of a Text box using the getText() method. How can I get the currently selected value of both a Checkbox (JCheckBox) and a Combobox (JComboBox)?

Please give example.

Thanks!
 
try using isSelected() for the checkbox and radio buttons.

as for combo boxes, well you might set these up using an array, in which case you can use getSelectedIndex().
 
Yes! pipK your suggestions worked great.

Thanks!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top