FileDocCategorySizeDatePackage
DrawStringDemo.javaAPI DocExample790Sun Jan 07 16:08:44 GMT 2001None

DrawStringDemo

public class DrawStringDemo extends JFrame

Fields Summary
String
message
Constructors Summary
public DrawStringDemo()

    
    super("DrawStringDemo");
  
Methods Summary
public static voidmain(java.lang.String[] args)

    JFrame frame = new DrawStringDemo();
    frame.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {System.exit(0);}
    });

    frame.pack();
    frame.setVisible(true);
  
public voidpaint(java.awt.Graphics g)

    Graphics2D graphics2D = (Graphics2D)g;
    GraphicsEnvironment.getLocalGraphicsEnvironment();
    Font font = new Font("LucidaSans", Font.PLAIN, 40);
    graphics2D.setFont(font);
    graphics2D.drawString(message, 50, 75);