② TestThread類
TestThread類是處理事務線程
public class TestThread extends Thread
{
public void run()
{
for (int i =
{
System
}
}
}
③ ThreadDiag類
ThreadDiag類用來顯示
import java
import javax
public class ThreadDiag extends Thread
{
private Thread currentThread = null;//實際調用時就是TestThread事務處理線程
private String messages =
private JFrame parentFrame = null;//提示框的父窗體
private JDialog clueDiag = null;//
private Dimension dimensions = Toolkit
private int width = dimensions
private int left =
public ThreadDiag(JFrame parentFrame
{
this
this
this
initDiag();//初始化提示框
}
protected void initDiag()
{
clueDiag = new JDialog(parentFrame
clueDiag
JPanel testPanel = new JPanel();
JLabel testLabel = new JLabel(messages);
clueDiag
testPanel
(new DisposeDiag())
}
public void run()
{
//顯示提示框
int left = (dimensions
int top = (dimensions
clueDiag
clueDiag
clueDiag
}
}
[
From:http://tw.wingwit.com/Article/program/Java/gj/201311/27677.html