update icon loader for choice mode

This commit is contained in:
Douglas Gillespie 2024-10-10 13:14:07 +01:00
parent 653dc584ed
commit 59f9dcb969
2 changed files with 8 additions and 5 deletions

View File

@ -76,13 +76,16 @@ public class PamRunModeDialog extends PamDialog {
try { try {
Image img = ImageIO.read(getClass().getResource(File.separator+PamIcon.getPAMGuardIconPath(PamIcon.NORMAL))); String file = File.separator+PamIcon.getPAMGuardIconPath(PamIcon.NORMAL);
normalMode.setIcon(new ImageIcon(img)); // icon =
ImageIcon icon = new ImageIcon(ClassLoader.getSystemResource(file));
// Image img = ImageIO.read(ClassLoader.getSystemResource(file));
normalMode.setIcon(icon);
normalMode.setHorizontalAlignment(SwingConstants.TRAILING); normalMode.setHorizontalAlignment(SwingConstants.TRAILING);
viewerMode.setIcon(new ImageIcon(img)); viewerMode.setIcon(icon);
viewerMode.setHorizontalAlignment(SwingConstants.TRAILING); viewerMode.setHorizontalAlignment(SwingConstants.TRAILING);
} catch (IOException e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -26,7 +26,7 @@ public class PamIcon {
//the default is windows. Icon automatically resize on Windows. //the default is windows. Icon automatically resize on Windows.
String path = "Resources/pamguardIcon.png"; String path = "Resources\\pamguardIcon.png";
if (System.getProperty("os.name").equals("Linux") || System.getProperty("os.name").startsWith("Mac")) { if (System.getProperty("os.name").equals("Linux") || System.getProperty("os.name").startsWith("Mac")) {
switch (sizeFlag) { switch (sizeFlag) {