This has been confusing and irritating me for a while. I am working on a small program for a friend, and basically, it is a to-do list. Users can create a task with the AddAssignment
class. There are a couple of fields the user must complete, but I am working on the first one, the task name. Once the task is saved, it is added to the list, which is in the ViewAssignments
class. The JTextField for the task's name is known as textField
.
I want the text of lblAssignmentNa
, the JLabel in the ViewAssignments
to be set to the text of textField
on the press of btnCreateAssignment
, a button in the AddAssignment
class.
I'd appreciate only the code to change the JLabel's text to the same as textField
's text as an answer. Thanks.
And I'm sorry if you don't understand any of this. Just let me know if you need more information.