aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes CHECKBOXGROUP.. newbie here :( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "CHECKBOXGROUP.. newbie here :(" Watch "CHECKBOXGROUP.. newbie here :(" New topic
Author

CHECKBOXGROUP.. newbie here :(

kat Vicap
Greenhorn

Joined: Oct 17, 2009
Posts: 5
i cant get this thing to compile. i'm still stucked in this GUI part.



the error says that it cannot find symbol for the checkboxgroup()
help..
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

CheckboxGroup is with a lowercase b. Once you fix that you'll get another 3 compiler errors though, since JCheckBox (Swing) is not compatible with CheckboxGroup (AWT).

It appears you want to use a mutually exclusive selection: only one of the options. In that case, use a ButtonGroup with JRadioButton, not JCheckBox. Replace JCheckBox with JRadioButton and CheckboxGroup with ButtonGroup:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
kat Vicap
Greenhorn

Joined: Oct 17, 2009
Posts: 5
thank you
Brian Cole
Author
Ranch Hand

Joined: Sep 20, 2005
Posts: 862
Rob Prime wrote:use a ButtonGroup with JRadioButton, not JCheckBox


FYI, I'm pretty sure that ButtonGroup works fine with JCheckBox and JToggleButton in addition to JRadioButton.


bitguru blog
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

It should as it works with AbstractButton, but visually a JRadioButton is probably better here. A JCheckBox or JToggleButton doesn't say "only one option" like JRadioButton does.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CHECKBOXGROUP.. newbie here :(