Last active
August 29, 2015 14:27
-
-
Save DoNotLickToaster/80714cd8370cd89342df to your computer and use it in GitHub Desktop.
java web applet
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
<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> |
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 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