When I start my program I have 6 panels. Then I have some radio buttons and depending on the choice some panels hide. In this example I want to hide all panels except 1 and 2. When I click the radio button instead of hiding the rest of the panels and leave the first 2 panels in the current position, it moves them.
private void MonocButtonItemStateChanged(java.awt.event.ItemEvent evt) {
Panel3.setVisible(false);
Panel4.setVisible(false);
Panel5.setVisible(false);
Panel6.setVisible(false);
}