我正在制作纸牌游戏应用程序。我有 2 个线程:
线程curr = 这里保存当前线程(JavaFx 线程)
线程proHs = 这是应用程序的大脑,它通过接口运行方法
我想停止线程proHs停止一秒钟,直到我选择这两个按钮中的一个mam nemam
然后我必须返回true或false。
我感谢任何建议或建议。谢谢!
我试过无限循环
public boolean biddingStep(int gt) { //above this method is @Override, I can't post this with it
System.out.println(" ");
System.out.println("I HAVE OR NOT PART");
try {
proHs.wait();
}
catch (Exception e) {
System.out.print(e);
}
panelLicitace.setVisible(true);
mam.setVisible(true);
nemam.setVisible(true);
return false;//there would be the resolution of button "mam" or "nemam"
}
编辑#1
我想从你这里得到什么:
public boolean biddingStep(int gt) { //above this method is @Override, I can't post this with it
System.out.println(" ");
System.out.println("I HAVE OR NOT PART");
panelLicitace.setVisible(true);
mam.setVisible(true);
nemam.setVisible(true);
// HERE a code i want
//1. stop proHS thread
//2. loop program, wait for input from 2 buttons
//3. return true or false
}
陪伴而非守候
相关分类