Created
May 24, 2013 02:55
-
-
Save avh4/5641001 to your computer and use it in GitHub Desktop.
CustomWidget implementation in Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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