• 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
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • 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: 75873
361
  • 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.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic