mi2.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
//System.out.println("close");
//System.exit(0);
}
});
st = new TrayIcon(image, "Tray Demo", popup);
try {
tray.add(st);
} catch (AWTException e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) {
new SystemTrayTest().start();
}
}
//使窗口最小化,并隐藏
public void windowIconified(WindowEvent e) {
System.out.print("sssssss");
jf.setVisible(false);
System.out.print(""+e+" "+e.getClass()+" "+e.getNewState());
}
责任编辑:cyth