java - JButton removing all the others jcomponent from a jpanel -


I have this functionality list added to a button:

  // home Executioner button activator for Home Executionist = new Editor () {Public Zero ActionPerfed (Action Event E) {removeAll (); Home Home = New Home (); (Home) add; }};  

This is the code for Genpel and Zbutton:

  // Creating Jenapel which will create button JPNL Button Panel = New JPNL (); ButtonPanel.setLayout (zero); ButtonPanel.setBounds (0,0,600,100); ButtonPanel.setBackground (Color.GRAY); Add (buttonPanel); // To send the user the home page Pocketton Home = New Pocket ("Home") to create a Jebton; Home.setBounds (25,25,100,50); ButtonPanel.add (home);  

How can I make it so that it can leave all GenPL components and leave the buttonplan that Genpel?

A possible solution would be to create a central panel that holds all the other components and instead Use removeAll on the container. Careful calling on

removeAll , on JFrame , this will remove the root panel which is not really what's for you.

And the Hovercraft Eulle has said that


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -