Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
arun singhal
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic