【初心者】Java質問・相談スレ6【大歓迎】
■ このスレッドは過去ログ倉庫に格納されています
0232デフォルトの名無しさん
NGNG-------------------------------------------------------------
import javax.swing.*; import java.awt.*; import java.io.*;
public class IconWatcher implements Icon {
final Icon icon;
public IconWatcher (Icon icon) { this.icon = icon; }
public int getIconHeight () { return icon.getIconHeight (); }
public int getIconWidth () { return icon.getIconWidth (); }
public void paintIcon (Component c, Graphics g, int x, int y) { icon.paintIcon (c, g, x, y); }
protected void finalize () throws Throwable { System.err.println ("finalized: "+ this); }
public static void main (String[] args) throws Exception {
JLabel label = new JLabel ();
label.setIcon (new IconWatcher (new javax.swing.plaf.metal.MetalCheckBoxIcon ()));
label.setIcon (new javax.swing.plaf.metal.MetalComboBoxIcon ());
System.gc ();
System.out.print ("enter ->");
BufferedReader d = new BufferedReader (new InputStreamReader (System.in));
d.readLine ();
}
}
-------------------------------------------------------------
finalized: IconWatcher@786e64
enter ->
-------------------------------------------------------------
■ このスレッドは過去ログ倉庫に格納されています