import java.awt.*; import java.awt.event.*; import javax.swing.*; class JTestFrame extends JFrame implements WindowListener { protected JCalendar jCalendar; public JTestFrame() { super("My Calendar Frame"); jCalendar = new JCalendar() { public void repaint() { System.out.println("repaint()"); super.repaint(); } public void repaint(long l) { System.out.println("repaint(" + l + ")"); super.repaint(l); } public void repaint(int p1, int p2, int p3, int p4) { System.out.println("repaint(" + p1 + "," + p2 + "," + p3 + "," + p4 + ")"); super.repaint(p1,p2,p3,p4); } public void repaint(long l, int p1, int p2, int p3, int p4) { System.out.println("repaint(" + l + "," + p1 + "," + p2 + "," + p3 + "," + p4 + ")"); super.repaint(l,p1,p2,p3,p4); } }; Container content_pane = getContentPane(); content_pane.setLayout(new BorderLayout()); content_pane.add(BorderLayout.CENTER,jCalendar); this.addWindowListener(this); pack(); setVisible(true); } public void windowClosing(WindowEvent e) { Window window = e.getWindow(); window.setVisible(false); window.dispose(); System.exit(0); } public void windowOpened(WindowEvent e) {} public void windowClosed(WindowEvent e) {} public void windowActivated(WindowEvent e) {} public void windowDeactivated(WindowEvent e) {} public void windowIconified(WindowEvent e) {} public void windowDeiconified(WindowEvent e) {} public static void main(String argv[]) { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); new JTestFrame(); } catch(Exception e) { e.printStackTrace(); } } }