FileDocCategorySizeDatePackage
PrintDemo.javaAPI DocExample7862Mon Apr 06 18:10:22 BST 1998None

PrintDemo

public class PrintDemo extends Frame

Fields Summary
Button
printText
Button
printGraphics
TextField
ringNum
Choice
faces
Graphics
g
Plot
plot
Toolkit
tk
Constructors Summary
public PrintDemo()

    
    ringNum.setText("3");
    ringNum.addTextListener(new RingL());
    Panel p = new Panel();
    p.setLayout(new FlowLayout());
    printText.addActionListener(new TBL());
    p.add(printText);
    p.add(new Label("Font:"));
    p.add(faces);
    printGraphics.addActionListener(new GBL());
    p.add(printGraphics);
    p.add(new Label("Rings:"));
    p.add(ringNum);
    setLayout(new BorderLayout());
    add(p, BorderLayout.NORTH);
    add(plot, BorderLayout.CENTER);
    String[] fontList = tk.getFontList();
    for(int i = 0; i < fontList.length; i++)
      faces.add(fontList[i]);
    faces.select("Serif");
  
Methods Summary
public static voidmain(java.lang.String[] args)

    Frame pdemo = new PrintDemo();
    pdemo.setTitle("Print Demo");
    pdemo.addWindowListener(
      new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
          System.exit(0);
        }
      });
    pdemo.setSize(500, 500);
    pdemo.setVisible(true);