TheCoder233
TheCoder233

Reputation: 3

How would I get the text of two jTextFields at once?

I've tried to use:

jTextField1 + jTextField2 = getText());

But it only retrieved the text from one text box.

Upvotes: 0

Views: 84

Answers (2)

Mickey695
Mickey695

Reputation: 108

You can not get the text of two JTextFields simultaneously, you can however get the text of one and concat it to the other.

See: JTextField.getText JavaDocs for more information.

Upvotes: 0

Reimeus
Reimeus

Reputation: 159774

Perhaps

String text = jTextField1.getText() + jTextField2.getText();

Upvotes: 1

Related Questions