Created
July 6, 2021 19:18
-
-
Save MichaelSDavid/b6dd03be1de0f6193adaa5b80a19a132 to your computer and use it in GitHub Desktop.
A small Java Applet that draws a minimalistic picture of Albert Einstein with a famous quote of his.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.JApplet; | |
import java.awt.*; | |
public class Applet extends JApplet { | |
// Einstein portrait | |
public void paint(Graphics page) { | |
page.drawRect(50, 50, 40, 40); // Square | |
page.drawRect(60, 80, 225, 30); // Rectangle | |
page.drawOval(75, 65, 20, 20); // Circle | |
page.drawLine(35, 60, 100, 120); // Line | |
page.drawString("Out of clutter, find simplicity.", 110, 70); | |
page.drawString("-- Albert Einstein", 130, 100); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment