• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is it possible to remove or hide a selected JCheckBox from a list of JcheckBoxes in GroupLayout?

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,
There are 8 JCheckboxes, which are already added to panel and aligned in group layout. From which, I have selected one JCheckbox. Then the resultant GUI should contain only remaining 7
JCheckboxes and selected one should temporarily removed or hide from GUI .
Is it possible? If so, how?

Thank You.
 
Marshal
Posts: 79044
375
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course you can remove and add boxes. But why? That will produce a very strange appearance.

You realise most buttons (which is what check boxes are) have a setEnabled method? You can enable and disable them as required.
 
Karri Tata Rao
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your suggestion. But I have to do that task. Can you guide me how it is possible to updation of CheckBoxes on selection of one checkbox.



Thank You friends
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All components have a setVisible() method. You can simply call setVisible(false) on the checkbox's action listener. Nevertheless, it would look odd when the checkbox disappears as soon as the user clicks on it.
 
Karri Tata Rao
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you friend. It is seems to be removed, but it is not temporarily removed from panel layout I think so.
 
reply
    Bookmark Topic Watch Topic
  • New Topic