Results 1 to 9 of 9

Thread: System Tray

  1. #1
    67726e is offline Member
    Join Date
    Mar 2010
    Location
    Hilton Head, SC
    Posts
    34
    Rep Power
    0

    Default System Tray

    Simply put, is there any Swing version of the SystemTray? The AWT looks f*** ugly.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    Do you have access to Google?

  3. #3
    67726e is offline Member
    Join Date
    Mar 2010
    Location
    Hilton Head, SC
    Posts
    34
    Rep Power
    0

    Default

    Well from my searching, the answer is no. I just thought I'd ask because while you can prove the existence of someting with ease, completely ruling something's existence out is a bit more of a task.

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    Strange when I use Google I get the standard million plus pages found.
    Did you spell System Tray correctly?

    New System Tray Functionality in Java SE 6
    The upcoming Java SE 6 release includes a new system tray API, which allows you to embed a small icon in the OS system tray, attach a popup menu, ...
    java.sun.com › ... › Java Platform, Standard Edition (Java SE) - Cached - Similar
    SystemTray (Java Platform SE 6)
    The SystemTray may contain one or more TrayIcons , which are added to the tray using the add(java.awt.TrayIcon) method, and removed when no longer needed, ...
    download-llnw.oracle.com/javase/6/docs/api/java/.../SystemTray.html - Cached
    System Tray Icon Support (The Java™ Tutorials > Graphical User ...
    System tray support was added in version 6 of Java SE. For more information, see the New System Tray Functionality in Java SE 6 article. ...
    download-llnw.oracle.com/javase/tutorial/ui/features/tray.html - Cached
    Getting to Know System Tray : Core Java Technologies Tech Tips
    Nov 5, 2007 ... However, one thing massively bugging me is that there is no way whatsoever to make standard Java SystemTray visually fit into Linux/Unix ...
    blogs.sun.com/CoreJavaTechTips/.../getting_to_know_system_tray - Cached - Similar
    How do I disable the Java Icon in the Windows System Tray?
    A java icon is shown in the Windows system tray whenever an application or applet written with Java technology is running.
    http://www.java.com/en/download/help..._java_icon.xml - Cached - Similar
    JTray - Java System Tray API
    A Java System Tray API for Windows. [Commercial, trial version]
    www.jpackages.com/jtray/ - Cached - Similar
    Swing: System Tray Icons
    7 posts - 6 authors - Last post: Dec 6, 2004
    Re: Swing: System Tray Icons. I think it's great that we have these kinds of abilities to integrate Java better with the host environ. ...
    http://www.javalobby.org/forums/thre...threadID=16181... - Cached - Similar
    Java System Tray (under construction)
    This page will provide a Java API to be used (currently only in Windows) to add icons in system tray from a java program. There are other projects on the ...
    members.multimania.co.uk/gciubotaru/systray/ - Cached
    Java Tips - Adding Icons to System Tray
    Java Tips -- Java, Java, and more Java, Adding Icons to System Tray.
    http://www.java-tips.org/other.../ad...em-tray-2.html - Cached - Similar
    How to Use the System Tray with Java: Adding a Java Application to ...
    Jan 27, 2009 ... Adding a Java Application to the Windows System Tray is very easy - provided, of course, that the programmer knows which packages and ...
    java-programming.suite101.com/.../how_to_use_the_system_tray_with_java - Cached - Similar
    Searches related to java system tray

  5. #5
    67726e is offline Member
    Join Date
    Mar 2010
    Location
    Hilton Head, SC
    Posts
    34
    Rep Power
    0

    Default

    Maybe I didn't word my problem correctly. The standard tray is AWT, is there a Swing way? I know how to create a tray icon and all, I'm just wondering because I prefer the ability to use a look and feel (as stupid as that may sound) instead of the system's set look.

  6. #6
    Prajin's Avatar
    Prajin is offline Senior Member
    Join Date
    Jun 2010
    Location
    Ktm, Nepal
    Posts
    120
    Rep Power
    0

    Default

    Didn't u said : can't find system tray in swing. So I haven't also.
    There is no system tray in swing.
    By the way, awt tray look nice and if you really think there should be tray in swing, then why not report this to sun.
    -regards

  7. #7
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,361
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by 67726e View Post
    Maybe I didn't word my problem correctly. The standard tray is AWT, is there a Swing way? I know how to create a tray icon and all, I'm just wondering because I prefer the ability to use a look and feel (as stupid as that may sound) instead of the system's set look.
    The core SE distribution only contains AWT tray support; it makes sense: why have another LAF in the system tray? If you really want that there is (was?) JDIC which uses Swing components for the system tray. Google is your friend here.

    kind regards,

    Jos

  8. #8
    Maxideon is offline Member
    Join Date
    Jun 2010
    Posts
    28
    Rep Power
    0

    Default

    A class called JXTrayIcon and a corresponding blog post that talks about it.

    Summary:
    You can add a mouse listener to the TrayIcon and show a JPopupMenu upon an appropriate mouse event. The JPopupMenu needs a parent. So initially the solution was to pass itself as the parent. But this had 3 main problems,

    1) A ClassCastException was occasionally thrown
    2) Lightweight popups didn't overlap the taskbar
    3) Using itself as the parent prevented the popup from closing by clicking on the desktop.

    Java 1.6u10 fixed the first two problems. JXTrayIcon addresses the third problem.
    Last edited by Maxideon; 08-12-2010 at 03:19 PM.

  9. #9
    67726e is offline Member
    Join Date
    Mar 2010
    Location
    Hilton Head, SC
    Posts
    34
    Rep Power
    0

    Default

    Thanks Maxideon. That is pretty much the best thing I've seen. I did look into the JDIC but that turned into a large PITA due some 32 vs 64 bit issues. This works and doesn't take some serious screwing around to accomplish. Thank you, this is a life saver.

Similar Threads

  1. minimize button and system tray
    By Kenan89 in forum New To Java
    Replies: 1
    Last Post: 12-10-2009, 03:31 AM
  2. Minimize to System Tray In Windows
    By shapeshifter in forum AWT / Swing
    Replies: 4
    Last Post: 12-07-2008, 01:42 PM
  3. System Tray Message tracking.
    By Hichhiker in forum AWT / Swing
    Replies: 2
    Last Post: 10-11-2008, 03:58 AM
  4. Replies: 0
    Last Post: 07-25-2008, 02:32 PM
  5. System Tray
    By JavaLerner in forum New To Java
    Replies: 2
    Last Post: 07-13-2008, 08:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •