SyntaxFix
Write A Post
Hire A Developer
Questions
the getText method returns a String, while the setText receives a String, so you can write it like label1.setText(nameField.getText()); in your listener.
getText
setText
label1.setText(nameField.getText());