How to make JDialog the topmost, but not modal?

I am creating an applet. This applet should take some large chunks of data from db, and this operation is slow ... Therefore, I would like to create a β€œbootable” JDialog that will be displayed on top of the applet, while the applet loads data from DB, but it should not block input user in applet.
How to do it? If I create a JDialog that is "setAlwaysOnTop (true)", it will not display on top. If I set it to modal, it will show, but it will not allow my applet to contact the database. I even tried to make this "boot" runnable window and run it from another thread, no luck.

How to make a correct, universal, β€œloading” JDialog for an applet that will NOT be modal, but will always remain on top?

+4
source share
1 answer

All in all a very (and I mean very) bad idea to call swing / awt from a non-EDT stream. Rest assured, there are many problems with the way the JFrame / JDialog applet works on OSX and Windows. IMO this would do much better if your applet just used JProgressBarr or something in your applet interface directly. If you need to popup, use a JFrame with AlwaysOnTop=true . The reason you get weird behavior is because you probably aren't using a constructor that accepts a parent component or just pass null .

+2
source

All Articles