ちょっと変更した画像ビュア
ImageViewer.java
public class ImageViewer { public static void main(String[] args) { if (args.length > 0) javax.swing.JOptionPane.showMessageDialog(null, null, args[0], 0, new javax.swing.ImageIcon(args[0])); } }
せっかく画像をIconとして持っているのでJLabelに貼り付けたりせずに直接アイコンとして指定。大きい画像を開いてしまうと閉じるのが面倒なのは一緒。まあ了解ボタンが見切れていることを知っていれば全く面倒はないですが。