The Source for Java Technology Collaboration

Home » java.net Forums » Java Desktop Technologies » Swing & AWT

Thread: SystemTray prevents Swing from shutting down?

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 2 - Last Post: Sep 14, 2008 11:41 PM by: Anton V. Tarasov
cowwoc

Posts: 1,055
SystemTray prevents Swing from shutting down?
Posted: Sep 12, 2008 9:23 AM
 
  Click to reply to this thread Reply

Hi,

Can anyone else reproduce this problem? It looks like something in the SystemTray code prevents Swing from shutting down once all windows are disposed.

If omit SystemTray.add(TrayIcon) from my code it shuts down fine.

Is this a known bug?

cowwoc

Posts: 1,055
Re: SystemTray prevents Swing from shutting down?
Posted: Sep 12, 2008 9:34 AM   in response to: cowwoc
 
  Click to reply to this thread Reply

Actually, I suspect this was done by design though I really wish the docs would mention this :)

Anyway, I worked around the problem by removing the TrayIcon when the user selects "Exit".

Anton V. Tarasov
Re: SystemTray prevents Swing from shutting down?
Posted: Sep 14, 2008 11:41 PM   in response to: cowwoc
  Click to reply to this thread Reply

This is to support applications that live only in system tray
and doesn't permanently keep windows on the screen.

AWT doesn't provide any option to prevent this behavior... In order to
let the app shutdown you should remove all <TrayIcon>s.

Thanks,
Anton.

swing@javadesktop.org wrote:
> Hi,
>
> Can anyone else reproduce this problem? It looks like something in the SystemTray code prevents Swing from shutting down once all windows are disposed.
>
> If omit SystemTray.add(TrayIcon) from my code it shuts down fine.
>
> Is this a known bug?
> [Message sent by forum member 'cowwoc' (cowwoc)]
>
> http://forums.java.net/jive/thread.jspa?messageID=299079





 XML java.net RSS