I have an application where I want that the user is able to choose between normal and advanced settings. Now if the user checks a JCheckBox and the advanced settings should disapper the problem starts.
My idea was to set all unnessecary swing components (JScrollPane, JLabel…) invisible and then find a method of JFrame which fits the window to the VISIBLE components.
My question is if there is such a method?
I have an application where I want that the user is able to choose
Share
1. You can use
setVisible(boolean b), to make the component visible and invisible.2. You can check that if the component is visible or not using
isVisible()3. You can then use the pack() method, pack() method gives sets the frame size as per need