Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import javax.swing.*;
  2. import java.awt.*;
  3.  
  4. public class ShapeTest extends JFrame{
  5. public ShapeTest(){
  6. setSize(400,400);
  7. setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  8. setLocationRelativeTo(null);
  9. setVisible(true);
  10. }
  11.  
  12. public static void main(String a[]){
  13. new ShapeTest();
  14. }
  15.  
  16. public void paint(Graphics g){
  17. g.drawOval(40, 40, 60, 60); //FOR CIRCLE
  18. g.drawRect(80, 30, 200, 200); // FOR SQUARE
  19. g.drawRect(200, 100, 100, 200); // FOR RECT
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement