Skip to content

Instantly share code, notes, and snippets.

@tonetheman
Created April 10, 2013 21:20
Show Gist options
  • Save tonetheman/5358538 to your computer and use it in GitHub Desktop.
Save tonetheman/5358538 to your computer and use it in GitHub Desktop.
Java file to show when paintComponent is being called.
import java.awt.*;
import javax.swing.*;
class DrawPanel extends JPanel {
public void paintComponent(final Graphics g) {
System.out.println("paintComponent called now!");
}
}
public class Crud {
public static void main(String[] args) {
JFrame f = new JFrame("testing");
f.setSize(300,300);
f.add(new DrawPanel());
f.setVisible(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment