From 2556cbc06393e5000e9fae9579f759354540dbd4 Mon Sep 17 00:00:00 2001 From: haya4 Date: Sun, 20 Oct 2019 12:44:50 +0900 Subject: [PATCH] fixed: --- .../gpx/matchtime/gui/restamp/DialogCorectTime.java | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/osm/jp/gpx/matchtime/gui/restamp/DialogCorectTime.java b/src/osm/jp/gpx/matchtime/gui/restamp/DialogCorectTime.java index 67fe187..e026cce 100644 --- a/src/osm/jp/gpx/matchtime/gui/restamp/DialogCorectTime.java +++ b/src/osm/jp/gpx/matchtime/gui/restamp/DialogCorectTime.java @@ -154,16 +154,21 @@ public class DialogCorectTime extends JDialog implements PanelAction { */ @SuppressWarnings("UseSpecificCatch") public void imageView_Action() { - String path = basetime.getImageFile().getImageFile().getAbsolutePath(); + try { + String path = basetime.getImageFile().getImageFile().getAbsolutePath(); - // View Image File - int size_x = imageSPane.getWidth() - 8; - ImageIcon tmpIcon = new ImageIcon(path); - refImage = tmpIcon; - if (tmpIcon.getIconWidth() > size_x) { - refImage = new ImageIcon(tmpIcon.getImage().getScaledInstance(size_x, -1, Image.SCALE_DEFAULT)); + // View Image File + int size_x = imageSPane.getWidth() - 8; + ImageIcon tmpIcon = new ImageIcon(path); + refImage = tmpIcon; + if (tmpIcon.getIconWidth() > size_x) { + refImage = new ImageIcon(tmpIcon.getImage().getScaledInstance(size_x, -1, Image.SCALE_DEFAULT)); + } + imageLabel.setIcon(refImage); + } + catch(NullPointerException e) { + // 何もしない } - imageLabel.setIcon(refImage); repaint(); } -- 2.11.0