If you want to copy the text only when the button status
is hit, then you can do:
status.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent pE) {
orders.setText(get.getText());
}
});
If you want to copy from Server Frame to Client frame or the opposite, you need to pass destination component to parent class in constructor:
JTextArea destTextArea;
public superclass(String string, JTextArea pDestTextArea) {
destTextArea = pDestTextArea;
}
....
public void actionPerformed(ActionEvent event){
if ((event.getSource() == status) && (destTextArea != null)) {
destTextArea.setText(get.getText());
}
}
Then to create your Client and Server:
super("CLIENT", null);
super("SERVER", orders);
or:
super("CLIENT", orders);
super("SERVER", null);