This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CHECKBOXGROUP.. newbie here :(

 
kat Vicap
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
kat Vicap
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you
 
Brian Cole
Author
Ranch Hand
Posts: 886
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rob Spoor
Sheriff
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic