I created a series of images of the numbers 1 through 9 by typing them in a Word document in a suitable font. Then I copied them from there into Microsoft Paint and saved them as JPEGs. Finally, I found an application online to trim them down to size. I wrote the following Java applet to display the number 1:
<applet code="DisplayNumbers" width=200 height=200>
public class DisplayNumbers extends Applet
public void init()
Number1 = getImage(getCodeBase(),"1r.jpg");
public void paint(Graphics g)
The code at the start allowed me to run the applet using appletviewer but without needing to create an HTML file.
Then I created an Image variable called Number1.
The getCodeBase() command provided the name of the directory where I ran the applet from. I used the getImage command to store this and the name of the JPEG in the Number1 variable.
I displayed the JPEG using g.drawImage and ran it as follows:
The output looked like this (as usual, click on the image to enlarge it and bring it into focus if necessary):