aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes When click on minimize button then it must goes to System Tray? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "When click on minimize button then it must goes to System Tray?" Watch "When click on minimize button then it must goes to System Tray?" New topic
Author

When click on minimize button then it must goes to System Tray?

arun singhal
Ranch Hand

Joined: Oct 25, 2009
Posts: 41
When anyone click on minimize or close button of window then it will go to Taskbar Status Area.
And when we click on close button then window will close but application don't close means it show icon in Taskbar Status Area.
Like as gtalk.when we click on close button of gtalk window then window goes to system tray .And gtalk application runs always.
How can it possible?
please some idea to write java code for this type of application.....
I am using window OS.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

1) Use JDK 1.6; that gives you java.awt.SystemTray and java.awt.TrayIcon
2) Set the default close operation to DO_NOTHING_ON_CLOSE
3) Add a WindowListener to your frame; use getExtendedState and setExtendedState. For instance, to minimize and restore use the following code:
Moving to Swing / AWT.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When click on minimize button then it must goes to System Tray?