Skip to content

Commit

Permalink
初期コミット。
Browse files Browse the repository at this point in the history
  • Loading branch information
takishim committed Feb 15, 2017
1 parent d92e054 commit 85f52df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/to/kishimo/minist/ImageViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -66,7 +67,11 @@ public void showImageAsText(int index) {
public void showImage(int index) {
BufferedImage image = makeImage(index);
Icon icon = new ImageIcon(image);
JOptionPane.showMessageDialog(null, labels[index], "MnistImageViewer", JOptionPane.PLAIN_MESSAGE, icon);
try {
JOptionPane.showMessageDialog(null, labels[index], "MnistImageViewer", JOptionPane.PLAIN_MESSAGE, icon);
} catch (HeadlessException e) {
System.out.println("Image dialog can't be displayed on CUI environment.");
}
}

/**
Expand Down

0 comments on commit 85f52df

Please sign in to comment.