Advertisement
konlawat007

DrawOval

Aug 22nd, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. package myLAB2;
  2. import java.awt.*;
  3. import javax.swing.*;
  4. public class HelloGraphicsWorld {
  5.  
  6.     public static void main(String[] args) {
  7.         JFrame frame = new JFrame() {
  8.             public void paint(Graphics g) {
  9.                 g.drawString("Hello, World!", 110, 150);
  10.                 g.drawOval(100, 130, 90, 30);
  11.                 g.drawOval(90, 120, 110, 50);
  12.             }
  13.         };
  14.          
  15.         frame.setSize(300, 300);
  16.         frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  17.         frame.setVisible(true);
  18.  
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement