Results 1 to 6 of 6
  1. #1
    zFollette is offline ▼ dafuq did I do?
    Join Date
    Dec 2013
    Posts
    203
    Rep Power
    0

    Default System Tray, clean transition?

    On minimize, I set my JFrame's visibility to false, I have an actionlistener set up so when I double click the process in the System Tray, the JFrame because visible again. The only problem is that when I reset it to visible, it kind of just flashes on the screen. Is there a way I can make the JFrame kind of just 'UN-minimize' instead of just flashing on?

    Here is the VERY simple code I am using:

    Java Code:
    if (e.getSource().equals(displayMenu) || e.getSource().equals(icon)) {
                    frame.setVisible(true);
                    frame.setState(JFrame.NORMAL);
                }

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,388
    Rep Power
    5

    Default Re: System Tray, clean transition?

    I just did a quick test. Why not create two inner classes? One extends WindowAdapter and the other extends MouseAdapter. Then, just intercept the appropriate events and modify the window state.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  3. #3
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: System Tray, clean transition?

    Are you asking if there's a way to make it perform the window manager's restore animation?
    Get in the habit of using standard Java naming conventions!

  4. #4
    zFollette is offline ▼ dafuq did I do?
    Join Date
    Dec 2013
    Posts
    203
    Rep Power
    0

    Default Re: System Tray, clean transition?

    Yes, sorry. I didn't know what to call it.

  5. #5
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: System Tray, clean transition?

    I doubt it. This would be controlled by how thoroughly your JVM integrates with your system. I've noticed quirks like Java windows always supplying a 32x32 icon to the window manager, resulting in blurry icons in the task switcher which uses 64x64 icons. (And this happens even if you use Window#setIconImages(List<? extends Image> icons) and supply multiple resolutions.) There's not much you can do about it. And don't even get me started on Apple's Java Extensions...
    Get in the habit of using standard Java naming conventions!

  6. #6
    zFollette is offline ▼ dafuq did I do?
    Join Date
    Dec 2013
    Posts
    203
    Rep Power
    0

    Default Re: System Tray, clean transition?

    To add to the resolution thing, the System Tray resolution is 16x16. So right off the bat if you want your images to look good, you need 16x16, 32x32, and 64x64.

Similar Threads

  1. System Tray
    By 67726e in forum AWT / Swing
    Replies: 8
    Last Post: 08-12-2010, 04:21 PM
  2. minimize button and system tray
    By Kenan89 in forum New To Java
    Replies: 1
    Last Post: 12-10-2009, 03:31 AM
  3. Minimize to System Tray In Windows
    By shapeshifter in forum AWT / Swing
    Replies: 4
    Last Post: 12-07-2008, 01:42 PM
  4. System Tray Message tracking.
    By Hichhiker in forum AWT / Swing
    Replies: 2
    Last Post: 10-11-2008, 03:58 AM
  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
  •