• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Karri Tata Rao
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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.
 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!