本文整理了Java中java.awt.TrayIcon.addMouseListener()
方法的一些代码示例,展示了TrayIcon.addMouseListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TrayIcon.addMouseListener()
方法的具体详情如下:
包路径:java.awt.TrayIcon
类名称:TrayIcon
方法名:addMouseListener
暂无
代码示例来源:origin: runelite/runelite
trayIcon.addMouseListener(new MouseAdapter()
代码示例来源:origin: igniterealtime/Openfire
trayIcon.setImageAutoSize(true);
trayIcon.addActionListener(actionListener);
trayIcon.addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) {
代码示例来源:origin: RipMeApp/ripme
trayIcon.setPopupMenu(trayMenu);
SystemTray.getSystemTray().add(trayIcon);
trayIcon.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
代码示例来源:origin: i2p/i2p.i2p
private TrayIcon getAWTTrayIcon(String tooltip) throws AWTException {
PopupMenu menu = getMainMenu();
if (!SystemVersion.isWindows())
menu.setFont(new Font("Arial", Font.BOLD, 14));
TrayIcon ti = new TrayIcon(getTrayImage(), tooltip, menu);
ti.addMouseListener(new MouseListener() {
public void mouseClicked(MouseEvent m) {}
public void mouseEntered(MouseEvent m) {}
public void mouseExited(MouseEvent m) {}
public void mousePressed(MouseEvent m) { updateMenu(); }
public void mouseReleased(MouseEvent m) { updateMenu(); }
});
return ti;
}
代码示例来源:origin: i2p/i2p.i2p
frame.add(menu);
TrayIcon ti = new TrayIcon(getTrayImage(), tooltip, null);
ti.addMouseListener(new MouseListener() {
public void mouseClicked(MouseEvent e) {}
public void mouseEntered(MouseEvent e) {}
代码示例来源:origin: tomighty/tomighty
@PostConstruct
public void initialize() {
bus.subscribe(new UpdateTimeOnTray(), TimerTick.class);
bus.subscribe(new ShowTomatoIconWhenTimerStops(), TimerStopped.class);
bus.subscribe(new RemoveTimeFromTray(), TimeOnTrayConfigChanged.class);
trayIcon = new TrayIcon(icons.tomato());
trayIcon.addMouseListener(new TrayListener());
trayIcon.setImageAutoSize(true);
}
代码示例来源:origin: stackoverflow.com
TrayIcon trayIcon = ...;
JPopupMenu popupMenu = ...;
JPopupMenuMouseAdapter jPopupMenuMouseAdapter = new JPopupMenuMouseAdapter(popupMenu);
trayIcon.addMouseListener(jPopupMenuMouseAdapter);
代码示例来源:origin: org.codeartisans.swing-on-steroids/sos-ui-swing
@Override
public HandlerRegistration addClickHandler( final ClickHandler<Void> handler )
{
final MouseListener listener = new MouseAdapter()
{
@Override
public void mouseReleased( MouseEvent e )
{
workQueue.enqueue( new Runnable()
{
@Override
public void run()
{
handler.onClick( new ClickNotification<Void>() );
}
} );
}
};
trayIcon.addMouseListener( listener );
return new HandlerRegistration()
{
@Override
public void removeHandler()
{
trayIcon.removeMouseListener( listener );
}
};
}
代码示例来源:origin: stackoverflow.com
trayIcon.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
代码示例来源:origin: stackoverflow.com
trayIcon.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
代码示例来源:origin: stackoverflow.com
try {
final TrayIcon trayIcon = new TrayIcon(new ImageIcon("/usr/share/icons/gnome/16x16/emotes/face-plain.png").getImage());
trayIcon.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
代码示例来源:origin: stackoverflow.com
trayIcon.addMouseListener(new MouseAdapter() {
public void mouseReleased(MouseEvent e) {
if (e.isPopupTrigger()) {
代码示例来源:origin: com.numdata/numdata-swing
consoleTrayIcon.addMouseListener( new MouseAdapter()
代码示例来源:origin: stackoverflow.com
trayIcon.addMouseListener(mouseListener);
代码示例来源:origin: com.github.tornaia/aott-desktop-client-core
trayIcon.setImageAutoSize(true);
trayIcon.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
代码示例来源:origin: org.nuiton.web/nuiton-web
TrayIcon icon = new TrayIcon(image, serverName, menu);
icon.setImageAutoSize(true);
icon.addMouseListener(this);
代码示例来源:origin: stackoverflow.com
trayIcon.addMouseListener(mouseListener);
代码示例来源:origin: ATLauncher/ATLauncher
/**
* This tries to create the system tray menu.
*
* @throws Exception
*/
private static void trySystemTrayIntegration() throws Exception {
if (SystemTray.isSupported()) {
SystemTray tray = SystemTray.getSystemTray();
TrayIcon trayIcon = new TrayIcon(Utils.getImage("/assets/image/Icon.png"));
trayIcon.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON3) {
TRAY_MENU.setInvoker(TRAY_MENU);
TRAY_MENU.setLocation(e.getX(), e.getY());
TRAY_MENU.setVisible(true);
}
}
});
trayIcon.setToolTip(Constants.LAUNCHER_NAME);
trayIcon.setImageAutoSize(true);
tray.add(trayIcon);
}
}
代码示例来源:origin: blurpy/kouchat
trayIcon.addMouseListener(this);
trayIcon.setToolTip(Constants.APP_NAME);
代码示例来源:origin: abc9070410/JComicDownloader
trayIcon.addMouseListener(this);
} else {
trayIcon = null;
内容来源于网络,如有侵权,请联系作者删除!