import java.awt.Font; import java.awt.Graphics; import java.awt.Frame; import java.applet.Applet; public class Fenster3_Text extends Applet { public static void main(String[] args) { Frame f = new Frame("Fenster mit Text"); f.setSize(400,300); f.add(new Fenster3_Text()); f.setVisible(true); } // paint() aus Applet soll zeichnen. 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, 34); g.setFont(f); g.drawString("Normal (plain) TimesRoman", 10, 25); g.setFont(fb); g.drawString("Fett (bold) TimesRoman", 10, 50); g.setFont(f2i); g.drawString("Schräg (italics) Arial", 10, 100); } }