Panel components disappear when I minimize frame
问题 I have a layout with a main panel whose content is decided by me throught buttons in this way: public void actionPerformed(ActionEvent e) { mainPanel.removeAll(); //removing all current panel components if(e.getActionCommand().equals("content1")){ mainPanel = new Content1Panel(); add(mainPanel,BorderLayout.CENTER); validate(); }else if(e.getActionCommand().equals("content2")){ mainPanel = new Content2Panel(); add(mainPanel,BorderLayout.CENTER); validate(); } } now, if I minimize the frame and