UNB/ CS/ David Bremner/ teaching/ java/ PromptField.java
import java.awt.FlowLayout;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class PromptField extends JPanel{
    private JLabel label;
    private JTextField field;

    public PromptField(String prompt, int width){
        label=new JLabel(prompt);
        field=new JTextField(width);
        setLayout(new FlowLayout());
        add(label);
        add(field);
    }
    
    public void  setText(String arg){
        field.setText(arg);
    }
    
    public String getText(){
        return field.getText();
    }
    
    public void setEditable(boolean flag){
        field.setEditable(flag);
    }
}
//