我正在使用Java图形界面(Swing,AWT)。我的应用程序中的数据输入应该通过JFrame
完成。事实上,我有10个实体需要10 JFrame
。我使用了for
循环,但JFrame
似乎没有等到数据输入。Java GUI应用程序
我用Thread.sleep()
但徒劳无功。任何帮助?
下面是我的一些代码:
for (int i=0; i < VMnumber; i++) // VMnumber : number of virtual machines to instantiate
{
mips=0;
frame=new VMcaracteristics(); // VMcaracteristics is a JFrame to enter VMs caracteristics
frame.setVisible(true);
while (!VMcaracteristicsFlag) // Current frame is still open
{
Thread.sleep(100);
} // create a VM correspondent to the current frame
vm = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new CloudletSchedulerTimeShared());
vmlist.add(vm);
}
我们可以得到一些代码吗?也许初始化和涉及循环的部分? – Mshnik 2014-08-27 18:04:50
你尝试了什么?任何代码示例? – 2014-08-27 18:05:04
你正在寻找一个“提交”按钮,或者是在检测到配置发生任何变化的时候?我认为现在不需要更多的代码/细节来确定你想要发生什么,以及目前发生了什么。 – user2813274 2014-08-27 18:05:17