• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

CHECKBOXGROUP.. newbie here :(

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Sheriff
Posts: 22849
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you
 
Author
Posts: 986
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 22849
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic