Package io.github.astrapi69.awt.system
Class SystemTrayFactory
java.lang.Object
io.github.astrapi69.awt.system.SystemTrayFactory
The class
SystemTrayFactory
provides factory methods for create system tray Menu-
Method Summary
Modifier and TypeMethodDescriptionstatic SystemTray
newSystemTray
(@NonNull TrayIcon trayIcon, @NonNull PopupMenu popupMenu) static TrayIcon
newTrayIcon
(String imgFilename, String appName, PopupMenu systemTrayPopupMenu, Map<String, ActionListener> actionListeners) Factory method for create aTrayIcon
object
-
Method Details
-
newSystemTray
public static SystemTray newSystemTray(@NonNull @NonNull TrayIcon trayIcon, @NonNull @NonNull PopupMenu popupMenu) throws AWTException Factory method for create aSystemTray
from the givenTrayIcon
object and the givenPopupMenu
object- Parameters:
trayIcon
- the tray icon of theSystemTray
popupMenu
- the tray popup menu of theSystemTray
- Returns:
- the new
SystemTray
object - Throws:
AWTException
- is thrown if the desktop system tray is missing
-
newTrayIcon
public static TrayIcon newTrayIcon(String imgFilename, String appName, PopupMenu systemTrayPopupMenu, Map<String, ActionListener> actionListeners) Factory method for create aTrayIcon
object- Parameters:
imgFilename
- the img filenameappName
- the app namesystemTrayPopupMenu
- the system tray popup menuactionListeners
- the action listeners- Returns:
- the new
TrayIcon
-