Carl H. Sayres wrote:
>
> We have a lightweight component which creates a secondary Window
> as part of it's operation. This works fine in general on Linux
> (and anywhere else as well). The problem occurs when this component
> is used in a modal dialog. On Linux, the Modal dialog blocks any
> input to the contents of the Window.
>
> This problem does not exist on win32. (I'm not certain if the
> bug is in the Linux JDK and this should work, or in the win32
> JDK and this should not work! ;-) )
>
> Any suggestions?
>
> - Carl
Um, that's what modality means - that events don't reach the
underlying window. As you describe it, it would seem that the
Linux behaviour is correct. Then again, I've got modal
apps that I've run on Windows too, and they work correctly.
Keep in mind that there are 2 variants - you can use
JOptionPane.showMessageDialog (or ConfirmDialog, or whatever),
or you can use
JOptionPane.showInternalMessageDialog .
Which of these are you using? If you're seeing "funny stuff",
my guess is you're using the latter, and my suggestion would
be to use the former.
The former works best, and would be my recommendation for most
conceivable modal apps. The latter, in my experience, don't
handle repainting properly and are best avoided unless you have
a real application need for a modal InternalFrame.
Anyway, as to your perceived Linux/Win behaviour difference, that
sounds pretty odd (I hesitate to say implausable, but that's
what I'm thinking..) since Swing lightweight components are pure
Java, and use exactly the same drawing support regardless of platform.
There's nothing in the Linux vs. Windows JDK
that should have any effect on Swing behaviour.
Ron