package flexlabel; import java.awt.*; import java.awt.event.*; public class LabelTextAreaPanel extends Panel implements ActionListener { private LabelEditor editor; private TextArea label; private Button updateLabel; public LabelTextAreaPanel(LabelEditor e) { editor = e; setLayout(new BorderLayout()); add(label = new TextArea(5, 40), BorderLayout.CENTER); Panel buttonPanel = new Panel(); add(buttonPanel, BorderLayout.SOUTH); buttonPanel.add(updateLabel = new Button("Update Label")); updateLabel.addActionListener(this); } public void actionPerformed(ActionEvent e) { if (e.getSource() == updateLabel) { editor.setValue(label.getText()); editor.firePropertyChange(); } } }