Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple windows in eclipse window builder

I am using Google Window Builder for eclipse to create the UI aspect of my program. I need to create a preferences window so that the user can change different settings for the program. I want the user to be able to press the 'preferences' button in the menu to bring up a separate window. The problem I am having is that I do not know how to create or add components to this separate window visually through Window Builder. Is there a way I can create a jpanel that is not a child of the main jframe program through Window Builder?

like image 242
Jake Runzer Avatar asked Nov 15 '12 07:11

Jake Runzer


1 Answers

Right click on the package where you want the file for the new window to be stored. Go "New -> Other" and select "WindowBuilder -> Swing Designer -> JDialog". Write in a name for the class of the new Window. That will bring up an editor, select "Design" tab at the bottom of the window. Now you can customize this new window.

To open this window from your main JFrame you'll need do this:

MyNewWindowClass newWindow = new MyNewWindowClass();
newWindow.setVisible(true);
like image 131
Emma Vartdal Avatar answered Oct 23 '22 10:10

Emma Vartdal