[J2SE] 在一個CLASS裡面 想讓第二個JPanel 等待
我好像搞錯我的問題了>"<
想請問一下
我現在有兩個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)