user interface - Fading Indicator message in Java -


How to have a good library, when you receive messages, to create a fading signal message in Java like Outlook, Or when you connect to a network, Ubuntu / Genome

Java 1.6 has a tray incan class Information messages can be used to display.

  System Tray = SystemTray.getSystemTray (); Image Image = Toolkit.Get DefaultToolkit () GetImage ("tray.gif"); Tray icon tray icon = new tray icon (image, "tray demo"); Tray.add (trayicon); TrayIcon.displayMessage ("Hello, World", "Notification Demo", MessageType.INFO); Here is the result: 

On Linux you may also have a small program called a notification-dispatch. It makes it easy to invite standard freedesktop.org information systems from the shell. You can also run it from Java.

  string [] notifyCmd = {"notify-send", "hello, world!"}; . Runtime.getRuntime () Executive (notifyCmd);  

I had to do apt-get install libnotify-bin to get it on my Ubuntu box.


I tested these things on Windows 7 and Ubuntu 9.10 In each case the notification disappears after some time, which I think is The fading indicator the effect you want.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -