Created
June 13, 2013 02:39
-
-
Save InPermutation/5770862 to your computer and use it in GitHub Desktop.
The example applet from Wikipedia
This file contains hidden or 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 java.applet.Applet; | |
| import java.awt.*; | |
| // Applet code for the "Hello, world!" example. | |
| // This should be saved in a file named as "HelloWorld.java". | |
| public class HelloWorld extends Applet { | |
| // This method is mandatory, but can be empty (i.e., have no actual code). | |
| public void init() { | |
| } | |
| // This method is mandatory, but can be empty.(i.e., have no actual code). | |
| public void stop() { | |
| } | |
| // Print a message on the screen (x=20, y=10). | |
| public void paint(Graphics g) { | |
| g.drawString("Hello, world!", 20, 10); | |
| // Draws a circle on the screen (x=40, y=30). | |
| g.drawArc(40, 30, 20, 20, 0, 360); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment