Multiple windows in eclipse window builder
Asked Answered
C

1

5

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?

Cantabrigian answered 15/11, 2012 at 7:14 Comment(3)
"Multiple windows.." See The Use of Multiple JFrames, Good/Bad Practice? for alternatives.Connelly
I understand that it is bad practice but do not see any other way to create a preferences area.Cantabrigian
"do not see any other way to create a preferences area." There must have been 10 ways referenced in or from the answer. Did you see the answer?Connelly
A
9

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);
Apposite answered 15/11, 2012 at 14:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.