codisinmyvines

forthesun2

Nov 5th, 2021 (edited)
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1.  
  2. class MyFrame extends JFrame {
  3.     public MyFrame() {
  4.         setSize(800, 600);
  5.         setTitle("Picture 1");
  6.         setDefaultCloseOperation(EXIT_ON_CLOSE);
  7.         setVisible(true);
  8.         DrawComponent mc = new DrawComponent();
  9.         add(mc);
  10.  
  11.     }
  12. }
  13.  
  14. class DrawComponent extends JComponent {
  15.     public void paint(Graphics g) {
  16.         Graphics2D g2 = (Graphics2D) g;
  17.        
  18.     }
  19. }
  20.  
  21. public class PaintTask1 {
  22.     public static void main(String[] args) {
  23.         MyFrame f = new MyFrame();
  24.     }
  25. }
Add Comment
Please, Sign In to add comment