jQuery in Action, 3rd edition
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


Win a copy of Building Microservices this week in the Design forum!
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: 20080
    
  30

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 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: When click on minimize button then it must goes to System Tray?
 
It's not a secret anymore!