Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package myLAB2;
- import java.awt.*;
- import javax.swing.*;
- public class HelloGraphicsWorld {
- public static void main(String[] args) {
- JFrame frame = new JFrame() {
- public void paint(Graphics g) {
- g.drawString("Hello, World!", 110, 150);
- g.drawOval(100, 130, 90, 30);
- g.drawOval(90, 120, 110, 50);
- }
- };
- frame.setSize(300, 300);
- frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
- frame.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement