/* 
 * 1.1 Swing version.
 */

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

/* 
 * Very simple applet that illustrates parameters to text-drawing methods.
 */

public class TextXY extends JApplet {

    TextPanel textPanel;

    public void init() {
	textPanel = new TextPanel();
        getContentPane().add(textPanel);
    }
    
class TextPanel extends JPanel {

    public void TextPanel(){ }

    public void paintComponent(Graphics g) {
        Dimension d = getSize();
        g.drawString("drawString() at (2, 5)", 2, 5);
        g.drawString("drawString() at (2, 30)", 2, 30);
        g.drawString("drawString() at (2, height)", 2, d.height);
    }
}
    public static void main(String s[]) {
        JFrame f = new JFrame("TextXY");
        f.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {System.exit(0);}
        });
        JApplet applet = new TextXY();
        f.getContentPane().add(applet, BorderLayout.CENTER);
        applet.init();
        f.pack();
        f.setSize(new Dimension(550,100));
        f.show();
    }
}
