awt buttons

I am a student and learning java. I have written a program for a coursework, it includes 2 buttons (Submit & Reset). I would like the submit button to have 2 possible course of action depending on a checkBoxGroup button being selected.

I have tried to write an if...

if(cbg.equals(false)

.....setText("Error");

else

.....setText("submitted");

I have found through trial and error that this is wrong, can anyone point me in the right direction?

[491 byte] By [dadofsixa] at [2007-10-2 12:57:42]
# 1
I have answered my own question.The solution I came up with was...if(pt1.getState()==false)......setText("Error");pt1 was one of the checkboxes in the checkboxGroup.
dadofsixa at 2007-7-13 10:15:16 > top of Java-index,Java Essentials,Java Programming...
# 2
I lied!Still have an error if I click on one of the other checkboxes in the group I get the error message.
dadofsixa at 2007-7-13 10:15:16 > top of Java-index,Java Essentials,Java Programming...
# 3

Not 100% sure what you are trying to do but if you want to make sure one checkbox is selected then try

Checkbox currentCheckbox = cbg.getSelectedCheckbox();

if(currentCheckbox == null) {

// raise the error

} else {

//everything fine and do submit

}

floundera at 2007-7-13 10:15:16 > top of Java-index,Java Essentials,Java Programming...
# 4
Thank you flounder that works fine.
dadofsixa at 2007-7-13 10:15:16 > top of Java-index,Java Essentials,Java Programming...
# 5
Your welcome!
floundera at 2007-7-13 10:15:16 > top of Java-index,Java Essentials,Java Programming...