The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

This topic is READ ONLY
import-bot (20211) [Avatar] Offline
[Originally posted by karwatka]

I am writing an applet that contains a JTable which calls JOptionPane and
JDialog upon certain input.

When JOptionPane is called as modal it is not acutally modal. We call
JOptionPane inside a recursive method called from the seValueAt method in our
tableModel. When the user clicks on the JTable a new JOptionPane will appear.

If the JOptionPane was really modal the execution of the code in our model
should be halted until the JOptionPane was closed.

IMPORTANT: This only happens when using a browser. This does NOT happen in

JOptionPane invalidItemDialog = new JOptionPane();
invalidItemDialog.showMessageDialog(null, "Invalid Item Code",
"Warning", JOptionPane.WARNING_MESSAGE);

Note: The cell focus does not appear to change in the JTable.
import-bot (20211) [Avatar] Offline
Re: JDialog and JOptionPane not modal in JTable.
[Originally posted by karwatka]

After loading the Java Plugin 1.3beta the above modal problem has been solved.

We now have a new problem, in 1.3 the focus does not return to previous focus
owner after JOptionPane or JDialog are called.
import-bot (20211) [Avatar] Offline
Re: JDialog and JOptionPane not modal in JTable.
[Originally posted by matt]

This is interesting... I haven't done any work with 1.3beta yet so I can't
help specifically regarding version issues. But as a workaround, you could
query the focused componoent from the current FocusManager and store a
reference to it. Then when you dismiss your dialog, call requestFocus on that
previously focused component.

But you shouldn't have to implement a workaround... have you checked the JDC
bug database? Sorry I can't help more with this....