作者l70633 (释秋心)
看板java
标题[J2SE] 在一个CLASS里面 想让第二个JPanel 等待
时间Sun Mar 28 17:26:49 2010
我好像搞错我的问题了>"<
想请问一下
我现在有两个JPanel
我想让第二个JPanel等第一个JPanel的所有事件结束
才开始运作
但是我不知道该怎麽做 想请教一下板上的大大
以下是我的部分程式码
jb.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ab) {
for (int i = 0; i < name.chapter.length; i++) {
for (int j = 1; j < name.chapter[i].length; j++) {
if (((JComboBox) ab.getSource()).getSelectedItem().equals(
name.chapter[i][j])) {
desktop.removeAll();
t1 = new Type_I_Panel(i + j - 1, 0);
t1.setVisible(true);
desktop.add(t1);
//t2是我的第二个JPanel
t2 = new Type_II_Panel(i + j - 1, 0);
t2.setVisible(true);
desktop.add(t2);
}
}
}
}
});
※ 编辑: l70633 来自: 122.117.65.58 (03/28 21:36)