Removing JPanel from a JFrame in netbeans

Posted by jt153 on Stack Overflow See other posts from Stack Overflow or by jt153
Published on 2010-05-24T03:25:16Z Indexed on 2010/05/24 3:31 UTC
Read the original article Hit count: 247

Filed under:
|
|
|
|

So, I have several JPanels that contain buttons, labels, etc. that I want to switch between from a main JFrame. Currently I am trying to use the this.add(JPanelname); method and this.remove(JPanelname); with the validate(); and repaint(); methods

The problem is it will add the panel to the JFrame but it will not remove it. I am not sure how exactly to go about this and any help would be greatly appreciated.

© Stack Overflow or respective owner

Related posts about java

Related posts about swing