Search code examples
javaswingjtextfield

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.


Solution

  • Perhaps

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