import java.awt.Font;
import java.awt.Graphics;
public class FontTest extends java.applet.Applet {
public void paint(Graphics g) {
Font f = new Font("TimesRoman", Font.PLAIN, 18);
Font fb = new Font("TimesRoman", Font.BOLD, 18);
Font f2i = new Font("Arial", Font.ITALIC, 22);
g.setFont(f);
g.drawString("Normaler (plain) Font - TimesRoman", 10, 25);
g.setFont(fb);
g.drawString("Fetter (bold) Font - TimesRoman", 10, 50);
g.setFont(f2i);
g.drawString("Normaler (plain) Font - Arial", 10, 75);
}
}
Hier ist der Bereich, in dem das Applet zeichnen darf:
Und hier geht es wieder weiter auf der Seite.