Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package simpleapplet;
- import java.applet.Applet;
- import java.awt.Color;
- import java.awt.Graphics;
- /**
- *
- * @author 290826
- */
- public class SimpleApplet extends Applet {
- @Override
- public void init() {
- resize(400, 400);
- }
- public void paint(Graphics g) {
- g.setColor(Color.BLUE);
- g.drawOval(getWidth() / 2 - 20, getHeight() / 2 - 20, 40, 40);
- g.fillOval(getWidth() / 2 - 20, getHeight() / 2 - 20, 40, 40);
- g.drawOval(getWidth() / 2 - 40, getHeight() / 2 - 40, 80, 80);
- g.setColor(Color.red);
- g.drawLine(getWidth() / 2, getHeight() / 2 + 40, getWidth() / 2, getHeight() / 2 - 40);
- g.drawLine(getWidth() / 2 - 40, getHeight() / 2, getWidth() / 2 + 40, getHeight() / 2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement