是否有Scala的getText()等效?/我如何从Scala中的textField“抓取”?

时间:2022-07-27 13:47:58

This is how it is used in Java:

这是它在Java中的使用方式:

public void actionPerformed(ActionEvent evt) {
String text = textField.**getText**();
textArea.append(text + newline);
textField.selectAll();

}

Thanks for the help in advance!

我在这里先向您的帮助表示感谢!

1 个解决方案

#1


Exactly the same:

完全相同的:

val text = textField.getText

JTextField has a getText() method that you can call the same way in scala as you do in Java

JTextField有一个getText()方法,你可以像在Java中一样在scala中调用它

#1


Exactly the same:

完全相同的:

val text = textField.getText

JTextField has a getText() method that you can call the same way in scala as you do in Java

JTextField有一个getText()方法,你可以像在Java中一样在scala中调用它