combine multiple windows to a single window

偶尔善良 提交于 2019-12-13 05:52:40

问题


I am developing an application which have the following windows

If the information entered in the windows are correct than only the user will be prompted with the windows in the above sequence. Now the customer has demanded me with this user interface.

Now I have to add all these windows in the last window format, with the specification's as the user will be allowed in the 2nd portion of the last image if the first information entered is correct.And the user when launches this app see the last image and can change the values as any time in the respective portions of the last window. I have coded it in Swing Java.I am new to Java. I am working in Netbeans 7.1.2 I have three files as 1)Login.java -containing my LoginDemo class which have main and form object of extended Jframe class -Login class extending J frame and implementing action listener(this class creates an J frame of next file Enter the information. 2)Algorithm.java creates new J frame object of next file if information is correct. 3)TravellingSalesmanProblem.java gives the output as shown in Optimal Travel Route window. I am accessing the information using REST call to a website. So can anyone help me in this?


回答1:


This will depend on how you structured you code. If you simply placed components directly onto the the windows/frames themselves, then you might be in for some work.

Alternatively, if you used panels, which you then placed onto windows, this might save you some time.

Anyway. Assuming you only have windows.

for each window do
    myLastWindow.add(window.getContentPane());

This is pretty simple, but you'll also need to know the layout you want. I'd suggest something like GridLayout or VerticalLayout from the SwingX project.



来源:https://stackoverflow.com/questions/11373922/combine-multiple-windows-to-a-single-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!