我想让miniLayar显示为选项窗格,其中一个按钮的功能类似于tmbATM。那可能吗 :( 我绝望地怎么做。 每次按下该按钮,i值为+1。 谁能想到这个呢?
public void action() {
oke.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jlhNasabah = Integer.parseInt(inputAngka.getText());
for (i = 0; i <= jlhNasabah;) {
miniLayar.setVisible(true);
tmbATM.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
i += 1;
burstText.append((i) + "\tATM");
Nama = JOptionPane.showInputDialog("Masukkan Nama Anda :");
Alamat = JOptionPane.showInputDialog("Masukkan Alamat Anda : ");
NoKTP = JOptionPane.showInputDialog("Masukkan Nomor KTP Anda : ");
syncText.append("Nasabah Put Informasi\n");
burstText.append("\t3\t3\t3");
burstText.append("\n");
miniLayar.setVisible(false);
int reply = JOptionPane.showConfirmDialog(null, "Ingin Melanjutkan ?", "Konfirmasi", JOptionPane.YES_NO_OPTION);
if (reply == JOptionPane.NO_OPTION) {
i = jlhNasabah + 1;
}
}
});
}
}
});
}