Java线程启动与事件响应详解

//启动线程

public void start() {

if(TalkThread == null) {

TalkThread = new Thread(this);

TalkThread.start();

}

}

//响应动作事件

public void actionPerformed(ActionEvent evt) {

String btnCaption = evt.getActionCommand();

if(btnCaption.equals("通话")) {

// Add your action here

}

}

ppt 文件大小:9.22MB