Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make poping image in Systray area

 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Systray Icon class provides a convenient method to display a message, however I'd like to popup a arbitrary content, in my case I'd like to show a new song album art when an application is iconized mode. Generally it isn't look like a complicated task, I just want to verify:
1. systray icon doesn't support that
2. there is no open source solution around
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what "Systray Icon" package you're using - but I know that the JDIC Tray Icon supports including icons in the popup menu. You could use the album artwork as the icon.
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I refer system tray supported Java 6 and above. The package you refer is nice, however it is EA. So I'll keep a hope that it will be included in Java 7.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like there are some possible improvements to TrayIcon coming in JDK 7.

Unfortunately, it doesn't look like there's an easy way to pop an image up from a TrayIcon currently.

You could try to do something like popping up a JWindow temporarily near the bottom of the screen, but I've played around with it some, and my attempts weren't completely satisfactory - there's no way to get the real location you should pop up the window - you just have to assume the task bar is at the bottom of the screen, and that there aren't a ton of icons in the system tray pushing your icon far to the left, and that the taskbar isn't taking up multiple rows, etc. You also have to handle all the timing logic to show/hide your window.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic