I\'m trying to make input nameField appear in a Label called label1 after a Button called button1 is clicked
nameField
Label
label1
Button
button1
You are setting the label text before the button is clicked to "txt". Instead when the button is clicked call setText() on the label and pass it the text from the text field.
setText()
Example:
label1.setText(nameField.getText());