Meaningless Drivel is fun!*
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 Android Security Essentials Live Lessons this week in the Android 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: 19655
    
  18

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
 
jQuery in Action, 2nd edition
 
subject: When click on minimize button then it must goes to System Tray?
 
Similar Threads
questions regarding system tray and tray icon
IMPOTANT: Drop down Menu disappears partially behind system tray in windows
Minimize to tray on close button click.
how to minimize a window to system tray , and how to restore it from trayIcon's popup menu....???
About the IP of a RMI server