Miscellany
public java v1 · immutableimport javax.swing.*;import java.awt.*;public class Testing { public static void main(String[] arg) { JFrame frame = new JFrame(); JLabel label = new JLabel() { int c = 0; public void paint(Graphics g) { super.paint(g); invalidate(); c++; setText(new Integer(c).toString()); } }; frame.add(label); frame.pack(); frame.show(); }}