
import java.awt.Image;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author akulyakh
 */
public class SysTrayTest {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        try {
            
            boolean isSupported = SystemTray.isSupported();
            System.out.println("tray supported=" + isSupported);
        
            SystemTray tray = SystemTray.getSystemTray();
            System.out.println("tray=" + tray);

            Image image = Toolkit.getDefaultToolkit().getImage("./JavaCup.gif");
            System.out.println("image=" + image);

            TrayIcon icon = new TrayIcon(image, "Sample Icon");
            System.out.println("icon=" + icon);

            tray.add(icon);
            System.out.println("added");
            
        } catch(Exception x) {
            System.out.println("failed");
            x.printStackTrace();
        }
        
        System.out.println("Done");
        
        System.exit(1);
        
    }
}
