-1

I am trying to use a JDialog at the right of the screen, everything is almost perfect, but, if someone press the button on ther right end of the TaskBar, click on "Show Desktop area" my JDialog disappears I have to use ALT + TAB to get it back in in front. I can't set it AlwaysOnTop because I use other 3rd party programs that are fullscreen.

I tried:

jdigCentral.setAutoRequestFocus(true);
jdigCentral.setAlwaysOnTop(true);

and others, but without success

How can I have my JDialog to stay over just the Desktop Area?

Mandar Pandit
  • 2,171
  • 5
  • 36
  • 58
user2582318
  • 1,607
  • 5
  • 29
  • 47
  • Even always on top windows "disappear" when you click on the button to the right of the taskbar and select "Show Desktop". This is by design of Windows and you cannot easily (and should not) change it, – Nivas Jun 16 '14 at 17:11
  • possible duplicate of ["Always on Top" Windows with Java](http://stackoverflow.com/questions/297938/always-on-top-windows-with-java) – Frakcool Jun 16 '14 at 17:43
  • @Frakcool not, its not the same, but no problem you just want some points ok! – user2582318 Jun 16 '14 at 18:01
  • @Nivas ok, you got the point, thanks the answer!! i think i have to do something to make it visible again after some minutes!! – user2582318 Jun 16 '14 at 18:02
  • @user2582318 points? I don't get points at flagging the question. If that's not the same, then try to explain yourself in a better way. As it is, and given your actual code, it looks like [this answer](http://stackoverflow.com/a/297948/2180785). Also `the button on ther right end of the TaskBar` *what button do you mean?*. – Frakcool Jun 16 '14 at 18:07
  • Given your [comment](http://stackoverflow.com/questions/24248593/jdialog-over-desktop-area?noredirect=1#comment37456584_24248593) I think you're trying to dispose the Dialog, and you want it to appear after a certain amount of time? Then you can use [`Swing Timer`](http://docs.oracle.com/javase/tutorial/uiswing/misc/timer.html) to complete that task. Btw, in order to get better answers, you might want to take a look on [How to make a MCVE](http://stackoverflow.com/help/mcve) so we can test and be more *clear* when asking questions, this one was confusing. – Frakcool Jun 16 '14 at 18:09

1 Answers1

0

Is jdigCentral your dialog box? If so then try this:

jdigCentral.setModal(true);

That will keep the dialog box on top of the parent JFrame. But I'm confused about the use of the word Desktop Area. Do you mean you want to keep the dialog box on top of the parent frame, or do you want it to always show on top of all other programs running on your desktop?

Frakcool
  • 10,915
  • 9
  • 50
  • 89
user3669653
  • 354
  • 1
  • 8
  • 15
  • sorry the confusion, see Nivas answer, he got the point, i thought than this could be possible "easily", but as he said, no... – user2582318 Jun 16 '14 at 18:02