Results 1 to 6 of 6
- 04-10-2008, 12:24 PM #1
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
[SOLVED] Baloon message on a tray icon
Hi all,
How can I add a balloon message into a tray icon, without using a action listener.
Thanks
- 04-10-2008, 01:20 PM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Oh, it's simple. I've solved it.
- 04-10-2008, 01:21 PM #3
Hey Eranga... Can you post the solution here please? I'd like to know this one myself. Thanks
Did this post help you? Please
me! :cool:
- 04-10-2008, 01:25 PM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Sure, nothing to do much pal. Define a public trayicon variable. Then in the displayMessage() method check all the arguments are available or not.
This is only the code I used. Called it in an appropriate place of your application. I've add it just after the tray icon added to the system tray.Java Code:private void statusMessage(){ try{ trayIcon.displayMessage("Message Title", "Message Content", TrayIcon.MessageType.INFO); } catch(NullPointerException npe){ System.out.println(npe.getLocalizedMessage()); } }
- 04-10-2008, 01:30 PM #5
Nice one. Sure ill be using it in the future.
Did this post help you? Please
me! :cool:
- 04-10-2008, 02:12 PM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Why not. Easiest way, and the most perfect way I think :)
Only logic is make to happened something essential to JVM. Like exception handling.
Similar Threads
-
Minimize to System Tray In Windows
By shapeshifter in forum AWT / SwingReplies: 4Last Post: 12-07-2008, 01:42 PM -
Icon initialization problem
By saz25 in forum AWT / SwingReplies: 1Last Post: 12-24-2007, 10:37 PM -
Custom icon for Frame
By Java Tip in forum Java TipReplies: 0Last Post: 12-21-2007, 08:38 AM -
How to set an Icon in a Label?
By Soda in forum New To JavaReplies: 2Last Post: 12-07-2007, 12:38 PM -
To add an icon to my project
By Albert in forum AWT / SwingReplies: 1Last Post: 07-13-2007, 03:14 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks