Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Effective way to make a system tray application

This is my first post on Stack Overflow and I'm just wondering on the options of making a system tray application. The application would run primary from the system tray while still operating, and could be brought up into a window when clicked on. It is also needed to have some support for global keystroke tracking, to bring up a window.

I'm curious on what options I have available to me, as I'm sure that there are many ways to do this. I'm most familiar with with Java though I have some experience with C++. I'm willing to explore other languages if they have some definite perks to them, though it would be nice to work with what I know in a way.

Thank you


2 Answers

Java 6 has new functionality which allows for the creation of applications which use the system tray.

The New System Tray Functionality in Java SE 6 article goes into the details, and provides some sample code as well.

The newly added SystemTray and TrayIcon classes of the java.awt package can be used to add icons to the system tray. The icons can respond to mouse clicks and use pop up menus as well. However, this new functionality is a part of AWT, so it doesn't do a very good job integrating with Swing components.

Here's an example of a little clock that shows up in the system tray which was made using the SystemTray and TrayIcon classes in Java 6:

System tray clock application in Java
(source: coobird.net)

like image 173
coobird Avatar answered Nov 19 '25 13:11

coobird


Plain old Winforms would get my vote.

If you are familiar with Java you should have little difficulty using one of the managed languages to create a simple tray app with .NET.

Here is some advice on the correct way to create a tray app.

like image 43
Dan Avatar answered Nov 19 '25 14:11

Dan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!