Skip to content

Instantly share code, notes, and snippets.

@avh4
Created May 24, 2013 02:55
Show Gist options
  • Save avh4/5641001 to your computer and use it in GitHub Desktop.
Save avh4/5641001 to your computer and use it in GitHub Desktop.
CustomWidget implementation in Java
public class CustomWidget extends JComponent {
private List<RenderingCommand> rendering;
public void draw(List<RenderingCommand> rendering) {
this.rendering = rendering;
repaint();
}
public void paintComponent(Graphics g) {
for (RenderingCommand command : rendering) {
command.apply(g);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment