Skip to content

Instantly share code, notes, and snippets.

@DoNotLickToaster
Last active August 29, 2015 14:27
Show Gist options
  • Save DoNotLickToaster/80714cd8370cd89342df to your computer and use it in GitHub Desktop.
Save DoNotLickToaster/80714cd8370cd89342df to your computer and use it in GitHub Desktop.
java web applet
<html>
<head>
<title>Another Applet</title>
</head>
<body>
<p>My Java applet says:</p>
<!--assuming HelloAgainApplet.java has been compiled and is located in the same directory as the source-->
<applet code="HelloAgainApplet.class" width="200" height="50"></applet>
</body>
</html>
import java.awt.Graphics;
import java.awt.Font;
import java.awt.Color;
public class HelloAgainApplet extends java.applet.Applet {
Font f = new Font("TimesRoman", Font.BOLD, 36);
public void paint(Graphics g) {
g.setFont(f);
g.setColor(Color.red);
g.drawString("Hello, world!", 5, 25);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment