import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class TextFieldApplet extends JApplet
{
	JPanel contentPanel;
	JLabel label;
	JTextField textField;
	JButton button;
	
	public void init()
	{
		contentPanel = (JPanel)getContentPane();
		contentPanel.setLayout(new FlowLayout());
		label = new JLabel("Input text here: ");
		textField = new JTextField("A default value", 20);
		button = new JButton("OK");
	
		// You know the drill-- action handling will
		// be covered in a following chapter
		button.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent evt)
			{
				doMyButtonAction();
			}
		});
	
		contentPanel.add(label);
		contentPanel.add(textField);
		contentPanel.add(button);
	}
	
	public void doMyButtonAction()
	{
		showStatus(textField.getText());
	}
}
