アプレットに指定したURLの画像を表示
画像をWebから取得してアプレット内に表示したい。
なんか難しそうだと思ったら、めちゃくちゃ簡単だった。
URL url = new URL("http://example.com/image.gif"); ImageIcon icon = new ImageIcon(url); JLabel label = new JLabel(); label.setIcon(icon); label.setSize(icon.getIconWidth(), icon.getIconHeight());
どこにも通信とか描画の処理を書かなくておk。けっこう便利ー。