Advertisement
Guest User

JComponentTest

a guest
Jan 6th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. /*
  2.  * This work is licensed under a Creative Commons Attribution 3.0 Unported License, available
  3.  * at http://creativecommons.org/licenses/by/3.0/
  4.  *
  5.  * Please attribute by not editing the @author lines in any location on the source code.
  6.  * Last modified 1/6/2013
  7.  */
  8. import java.awt.Color;
  9. import java.awt.Graphics;
  10.  
  11. import javax.swing.JComponent;
  12.  
  13. /**
  14.  * This is a test to see how fast a JComponent can render a simple
  15.  * square. This tests with and without BufferedStrategy's.
  16.  *
  17.  * @author /u/Tjstretchalot
  18.  */
  19. public class JComponentTest extends JComponent {
  20.  
  21.     /**
  22.      *
  23.      */
  24.     public JComponentTest(boolean doubleBuf) {
  25.         setDoubleBuffered(doubleBuf);
  26.     }
  27.    
  28.     public void paintComponent(Graphics g) {
  29.         g.setColor(Color.RED);
  30.         g.fillRect(100, 100, 100, 100);
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement