Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JOptionPane is locking!!

 
Charlie Boss
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the listener for my selection box. When its selected i'm checking to make sure we have a transaction selected already. If theres no transaction selected, i show a dialog box which says: "You have to select a Transaction first." simple enuf huh.. my problem is the dialog box that pops up refuses to go away even after you click its "ok" button a guzzilion times.. its stuck on the applet and i can't do anything else till i get rid of it.. leaving my applet in a frozen state.. NOT GOOD.. have any of you experienced "frozen" dialogs and how can i remedy this. Thanks in advance.
cCabinet.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e){
JComboBox cb = (JComboBox)e.getSource();
cabinet = (String)cb.getSelectedItem();
//make sure we have a transaction
if ( cboTransaction.getSelectedIndex() != -1 ){
} else {
cCabinet.setSelectedIndex(-1);
JOptionPane.showMessageDialog(null, "You have to select a Transaction first.", "Warning: Required field not present.", JOptionPane.ERROR_MESSAGE);
}
}
});
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic