如何在用户按任意键然后执行某些/重复方法时检测键盘输入,除非没有摆动/ awt的退出按钮?用BufferedReader按Java中的Anykey
public static void isChecking(String x)throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String anykey = null;
System.out.print("Press Anykey to Continue : ");
anykey = br.readLine();
//if pressanykey
main(null); //call main class
//if escape button
System.out.println("Good Bye ");
System.exit(1);
}
谢谢
MRizq
在哪里“任意键”? –
除非转义键 – MRizq