Results 1 to 6 of 6
  1. #1
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    21

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    21

  3. #3
    DonCash's Avatar
    DonCash is offline Moderator
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    240
    Rep Power
    10

    Default

    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:

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    21

    Default

    Sure, nothing to do much pal. Define a public trayicon variable. Then in the displayMessage() method check all the arguments are available or not.

    Java Code:
        private void statusMessage(){
            try{
                trayIcon.displayMessage("Message Title", 
                "Message Content",
                TrayIcon.MessageType.INFO);
            }
            catch(NullPointerException npe){
                System.out.println(npe.getLocalizedMessage());
            }
        }
    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.

  5. #5
    DonCash's Avatar
    DonCash is offline Moderator
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    240
    Rep Power
    10

    Default

    Nice one. Sure ill be using it in the future.
    Did this post help you? Please me! :cool:

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    21

Similar Threads

  1. Minimize to System Tray In Windows
    By shapeshifter in forum AWT / Swing
    Replies: 4
    Last Post: 12-07-2008, 02:42 PM
  2. Icon initialization problem
    By saz25 in forum AWT / Swing
    Replies: 1
    Last Post: 12-24-2007, 11:37 PM
  3. Custom icon for Frame
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-21-2007, 09:38 AM
  4. How to set an Icon in a Label?
    By Soda in forum New To Java
    Replies: 2
    Last Post: 12-07-2007, 01:38 PM
  5. To add an icon to my project
    By Albert in forum AWT / Swing
    Replies: 1
    Last Post: 07-13-2007, 03:14 PM

Posting Permissions

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