fenster in tray minimieren wenn ich close button klicke

hazy

Grünschnabel
hi,

ich hab da mal ne frage:
SWT:
und zwar würde ich gern in mein Programm in mein system tray minimieren wenn ich den close button drücke...

hier mein quellcode:
// SystmTray
Image image = new Image(display, 16, 16);
image = new Image(display, ("fish.gif"));
Tray tray = display.getSystemTray();
if (tray != null) {
TrayItem trayItem = new TrayItem(tray, SWT.NONE);
trayItem.setImage(image);
final Menu menu = new Menu(shell, SWT.POP_UP);
MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
menuItem.setText("Öffnen");
menuItem = new MenuItem(menu, SWT.PUSH);
menuItem.setText("Schließen");
menuItem = new MenuItem(menu, SWT.PUSH);
menuItem.setText("Show Tooltip");

trayItem.addListener(SWT.MenuDetect, new Listener() {
public void handleEvent(Event event) {
menu.setVisible(true);
}
});
}
 
Zurück