Reputation: 215
i'm using Windowbuilder in Eclipse indigo.
I have a main JPanel, and I want to add a new Panel which will popup when I click a button. How can I see the new Panel insted of the main panel in the Design frame?
thanks!
Upvotes: 2
Views: 10277
Reputation: 394
Each panel should be created as its own subclass of JPanel in its own file. It is a very bad idea to use inner classes for something like this. WB intentionally does not support that style.
Upvotes: 0
Reputation: 52
There should be a window that is part of the Structure View called "Components". Click on the new JPanel from there. I did this a while ago but I do not currently have windowbuilder installed so I am not 100% positive. I will confirm it when I can.
Edit: Ok i took a look at it. Here's how it works. If you made a new Application Window, make sure the palette view is open (Window->Show View->Palette). Now I am pretty sure the best way to switch between panels is by using a card layout. So drag the card layout from the palette to the window. Now if you drag JPanels from the palette to getContentPane() in the components window, you can switch between those panels with buttons and such.
Upvotes: 2