为啥按钮不响应啊? 每个线程加个sleep(5)语句试试。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 void button2_actionPerformed(ActionEvent e) {dourl doit=new dourl();doit.doit(); }void button3_actionPerformed(ActionEvent e) {System.exit(0);}其中按钮2就是程序运行,它是一个死循环程序,但是我已经在循环里加入了if(Thread.activeCount()>10){ try{Thread.currentThread().wait();} catch(InterruptedException abcd) { }}try{Thread.currentThread().sleep(1000);}catch(InterruptedException abc){}可是程序按钮3依然不响应....就是点都不让点的那种 if(Thread.activeCount()>10){ java.util.Date thisTime=new java.util.Date(); java.util.Date lastTime=new java.util.Date(); lastTime.setTime(System.currentTimeMillis()); thisTime.setTime(System.currentTimeMillis()); //执行的代码 Thread.sleep(1000); lastTime.setTime(thisTime.getTime());} 字符串的位数 一个多线程的问题。 如何判断一个文件夹底下是否还有子文件夹? JTextArea的问题..... 一本Java书的问题(是Sun公司出的) 请问这段java程序错在哪里??? 一个极其挠头的问题,帮up有分。 java web start部署出错 求救,再线等待,50分 选什么? 如何发布jbuilder编写的应用程序?谢谢! Jdk在Linux上的安装问题
dourl doit=new dourl();
doit.doit();
}
void button3_actionPerformed(ActionEvent e) {
System.exit(0);
}
其中按钮2就是程序运行,它是一个死循环程序,但是我已经在循环里加入了if(Thread.activeCount()>10)
{
try{Thread.currentThread().wait();}
catch(InterruptedException abcd)
{
}
}
try{Thread.currentThread().sleep(1000);}
catch(InterruptedException abc)
{}可是程序按钮3依然不响应....就是点都不让点的那种
{
java.util.Date thisTime=new java.util.Date();
java.util.Date lastTime=new java.util.Date();
lastTime.setTime(System.currentTimeMillis());
thisTime.setTime(System.currentTimeMillis());
//执行的代码
Thread.sleep(1000);
lastTime.setTime(thisTime.getTime());
}