*/
@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();
}