Display Text Field Value to Another Text Field in Java

0
54

This tutorial is about Displaying a Text Field Value to another Text Field. This program uses jTextField, jLable, and jButton to complete this program.

Display a Text Field Value to another Text Field Steps

  1. Add or create a new JFrame Form.

2. Design your jFrame Form like the image below.

3. Double click your button and insert the code below.

  1. String name = jTextField1.getText() + " " + jTextField2.getText() + " " + jTextField3.getText();
  2. jTextField4.setText(name);

4. Run your program and the output just look like the image below.

Remember that jTextfield can be access using getText and setText and support only a String value.

Related Article You May Like:

Facebook Comments
(Visited 59 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here