简体   繁体   中英

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?

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM