将多个窗口合并为一个窗口 [英] combine multiple windows to a single window

查看:916
本文介绍了将多个窗口合并为一个窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发具有以下窗口的应用程序

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.

现在我必须以最后一个窗口格式添加所有这些窗口,并以规范的形式添加,因为如果输入的第一个信息正确,则允许用户进入最后一个图像的第二部分.最后一个图像,并且可以随时在最后一个窗口的各个部分中更改值. 我已经用Swing Java编写了代码.我是Java的新手.我在Netbeans 7.1.2中工作,我有三个文件,分别是 1)登录.java -包含我的LoginDemo类,该类具有扩展的Jframe类的main和form对象 -Login类扩展J框架并实现动作侦听器(此类将创建下一个文件的J框架.输入信息. 2)算法.java 如果信息正确,则创建下一个文件的新J框架对象. 3)TravellingSalesmanProblem.java 给出最佳行驶路线"窗口中所示的输出. 我正在使用REST呼叫网站来访问信息. 有人可以帮我吗?

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?

推荐答案

这将取决于您的代码结构.如果您只是将组件直接放置在窗口/框架本身上,则可能需要进行一些工作.

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

这很简单,但是您还需要知道所需的布局.我建议使用SwingX项目中的GridLayout或VerticalLayout之类的方法.

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.

这篇关于将多个窗口合并为一个窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆