Dont go crazy w/new features

This commit is contained in:
Alan O'Callaghan 2021-05-01 17:34:41 +01:00
parent 9dbb4f5da3
commit be0ade6ff0
2 changed files with 12 additions and 19 deletions

View File

@ -28,7 +28,6 @@
</resource>
</resources>
</build>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.dorkbox/SystemTray -->
<dependency>
@ -37,5 +36,4 @@
<version>4.1</version>
</dependency>
</dependencies>
</project>
</project>

View File

@ -142,12 +142,16 @@ public class ColorOracle extends WindowAdapter implements KeyListener, FocusList
return;
}
java.awt.EventQueue.invokeLater(() -> {
try {
new ColorOracle();
} catch (Exception ex) {
Logger.getLogger(ColorOracle.class.getName()).log(Level.SEVERE, null, ex);
System.exit(-1);
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
try {
new ColorOracle();
} catch (Exception ex) {
Logger.getLogger(ColorOracle.class.getName()).log(Level.SEVERE, null, ex);
System.exit(-1);
}
}
});
}
@ -232,21 +236,12 @@ public class ColorOracle extends WindowAdapter implements KeyListener, FocusList
* Initializes the tray icon and attaches it to the system tray.
*/
private void initTrayIcon() throws Exception {
// if (!SystemTray.isSupported()) {
// throw new Exception(TRAYICONS_NOT_SUPPORTED_MESSAGE);
// }
// get the SystemTray instance
// SystemTray tray = SystemTray.getSystemTray();
SystemTray tray = SystemTray.get("Color Oracle");
ImageIcon icon = loadImageIcon(MENUICON, "Color Oracle Icon");
Image image = icon.getImage();
tray.setImage(image);
tray.setTooltip(TOOLTIP);
// final Menu menu = tray.getMenu();
// create the menu
JMenu imenu = initMenu();
tray.setMenu(imenu);
}
@ -635,4 +630,4 @@ public class ColorOracle extends WindowAdapter implements KeyListener, FocusList
switchToNormalVision();
}
}
}
}