Skip to content

Instantly share code, notes, and snippets.

@InPermutation
Created June 13, 2013 02:39
Show Gist options
  • Select an option

  • Save InPermutation/5770862 to your computer and use it in GitHub Desktop.

Select an option

Save InPermutation/5770862 to your computer and use it in GitHub Desktop.
The example applet from Wikipedia
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