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

public class LabelsAndText {

    public static void main(String args[]) {

	// Create 5 pairs of JLabels and JTextFields, add them to a
	// JPanel and add the JPanel to a JFrame.
	JPanel panel = new JPanel();

	JLabel label1 = new JLabel("text 1:");
	JTextField text1 = new JTextField(8);
	text1.setEditable(true);
	label1.setLabelFor(text1);
	panel.add(label1);
	panel.add(text1);

	JLabel label2 = new JLabel("text 2:");
	JTextField text2 = new JTextField(8);
	text2.setEditable(true);
	label2.setLabelFor(text2);
	panel.add(label2);
	panel.add(text2);

	JLabel label3 = new JLabel("text 3:");
	JTextField text3 = new JTextField(8);
	text3.setEditable(true);
	label3.setLabelFor(text3);
	panel.add(label3);
	panel.add(text3);

	JLabel label4 = new JLabel("text 4:");
	JTextField text4 = new JTextField(8);
	text4.setEditable(true);
	label4.setLabelFor(text4);
	panel.add(label4);
	panel.add(text4);

	JLabel label5 = new JLabel("text 5:");
	JTextField text5 = new JTextField(8);
	text5.setEditable(true);
	label5.setLabelFor(text5);
	panel.add(label5);
	panel.add(text5);

	// Display the frame containing the 5 labels and panels.
	JFrame frame = new JFrame("");
	frame.getContentPane().add(panel, BorderLayout.CENTER);
	frame.setSize(500, 100);
	frame.setVisible(true);
    }
}
