我想从TextField输入文字,然后在TextArea中显示。为什么按下ENTER键后,就能在TextArea中看到?部分代码如下:
class TFListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
String s = tf.getText();
ta.setText(s);
tf.setText("");
}
}
图:
代码中并没有提到按ENTER就能在TextArea中看到,新手表示疑惑不解。
class TFListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
String s = tf.getText();
ta.setText(s);
tf.setText("");
}
}
图:
代码中并没有提到按ENTER就能在TextArea中看到,新手表示疑惑不解。