0

I have some troubles with determining the screen with taskbar(if there are a lot of screens)
I need to provide my application with the behavior described below.
User opens my java swing application and minimizes it (the icon is shown on taskbar).
The user closes the application: right click on the icon of taskbar, then close.
I want my app to show confirmation dialog on that screen where the taskbar is located.

So I used showOptionDialog of JOptionPane. If I invoke it with parentComponent set to null the dialog is shown on the main screen, not on screen which has taskbar.
That's why I need some solution to identify a screen with taskbar and show dialog there.

Fake Man
  • 271
  • 1
  • 3
  • 8

1 Answers1

0

Try

 java.awt.SystemTray.isSupported(); 

this can help you.

You can also check the object received by

 getSystemTray()

I hope this helps.

W A K A L E Y
  • 817
  • 1
  • 10
  • 14