update index.html
Former-commit-id: e7d6116dc6
Former-commit-id: c4bde6c917e9de33ddc612ef5be1bb91378b5a27
This commit is contained in:
@ -1,5 +1,13 @@
|
|||||||
package net.i2p.i2pfirefox;
|
package net.i2p.i2pfirefox;
|
||||||
|
|
||||||
|
import java.awt.Image;
|
||||||
|
import java.awt.MenuItem;
|
||||||
|
import java.awt.PopupMenu;
|
||||||
|
import java.awt.SystemTray;
|
||||||
|
import java.awt.Toolkit;
|
||||||
|
import java.awt.TrayIcon;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -236,4 +244,34 @@ public class I2PBrowser extends I2PCommonBrowser {
|
|||||||
i2pBrowser.launch(privateBrowsing,
|
i2pBrowser.launch(privateBrowsing,
|
||||||
visitURL.toArray(new String[visitURL.size()]));
|
visitURL.toArray(new String[visitURL.size()]));
|
||||||
}
|
}
|
||||||
|
public static void systray(String[] args) throws Exception {
|
||||||
|
if (!SystemTray.isSupported()) {
|
||||||
|
logger.warning("SystemTray is not supported");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SystemTray tray = SystemTray.getSystemTray();
|
||||||
|
Toolkit toolkit = Toolkit.getDefaultToolkit();
|
||||||
|
Image image = toolkit.getImage("trayIcon.jpg");
|
||||||
|
|
||||||
|
PopupMenu menu = new PopupMenu();
|
||||||
|
|
||||||
|
MenuItem messageItem = new MenuItem("Show Message");
|
||||||
|
messageItem.addActionListener(new ActionListener() {
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
// JOptionPane.showMessageDialog(null, "www.java2s.com");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
menu.add(messageItem);
|
||||||
|
|
||||||
|
MenuItem closeItem = new MenuItem("Close");
|
||||||
|
closeItem.addActionListener(new ActionListener() {
|
||||||
|
public void actionPerformed(ActionEvent e) { System.exit(0); }
|
||||||
|
});
|
||||||
|
menu.add(closeItem);
|
||||||
|
TrayIcon icon = new TrayIcon(image, "SystemTray Demo", menu);
|
||||||
|
icon.setImageAutoSize(true);
|
||||||
|
|
||||||
|
tray.add(icon);
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user