• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

TrayIcon for Windows Services

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I Created Windows service in java,
Actually my application wants to work like a service, i.e., Start automatically when windows start, work behind.. hidden.
So i created windows services, it is working what i expected.
Now, I have to show some icon of my application when that service is started.
How I get at least that icon on systemtray indicating service is running.

Thanks,
Ram
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's amazing the stuff you can find using Google: http://docs.oracle.com/javase/tutorial/uiswing/misc/systemtray.html
 
sharab rao
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Peter,

I have created that System trayicon notification.
Now my concern is, It is not working as expected.
Whenever I start services(Through service wizard of windows) a trayicon should populate at Systemtray.

 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's not really easy. A process running as a service cannot have an icon in the tray. You need to create a GUI application which will be run "normally" (eg. from a startup menu); this application would check whether your service is running and indicate it in the user interface in any way it likes (including an icon in the system tray). However, if the user uses eg. Task Manager or similar tool to forcibly close your GUI application, or if the application crashes, the service's state won't be accurately represented in the tray after that.

How to create this GUI application is the subject of your other question, of course.
 
sharab rao
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Martin Vajsar wrote:That's not really easy. A process running as a service cannot have an icon in the tray. You need to create a GUI application which will be run "normally" (eg. from a startup menu); this application would check whether your service is running and indicate it in the user interface in any way it likes (including an icon in the system tray). However, if the user uses eg. Task Manager or similar tool to forcibly close your GUI application, or if the application crashes, the service's state won't be accurately represented in the tray after that.

How to create this GUI application is the subject of your other question, of course.



Thanks Martin
reply
    Bookmark Topic Watch Topic
  • New Topic