Lost focus with dialog ...

Hello,

I have searched through the forums for this answer. I came across some that were close to what I am looking for, but not exact.

I have a Swing application with a copy of Swing components on it (jTextField, etc). I have to display a dialog box after the user exits each components. When they go from component A to component B, the component A dialog box appears (a good thing). However the focus hits component B. When the user clicks OK on the dialog, it triggers the lost focus on component B (a bad thing). So, when you go from component A to component B, you see both of thier dialogs. Does anyone know of a solution to this? Is there a way to flush the event queue? Maybe?

Thanks

Mike

[727 byte] By [mbrown36a] at [2007-10-2 11:03:47]
# 1

I did find a solution to this using a flag, although I was hoping to find something cleaner.

private void num1Handler(java.awt.event.FocusEvent evt) {

if (instate == 'N')

{

instate = 'A';

JOptionPane.showMessageDialog(null, "test");

instate = 'N';

}

}

mbrown36a at 2007-7-13 3:36:40 > top of Java-index,Desktop,Core GUI APIs...