how to make it update
Can you explain your problem a bit more?
Is the problem that the code to do the update is NOT being called
or is the problem that the code is not doing the update correctly?
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
Are you saying the button's action listener method is being called?
But the code in the action listener method is not doing what you want.
code to update the textfield
The text field has a method you need to call to update it.
What is the name of the textfield variable? I see this code that looks like it would update a textfield:
jButton_Update.setText("Update");
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
Where do you try to update jTextArea_EvidenceNotes in the action listener method?
If you want to update date the contents of that field, you need to call one of its methods just like you do here:
jButton_Update.setText("Update");
Do something like this:
jTextArea_EvidenceNotes.setText("THE DATA TO BE SHOWN");
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
Sorry, I don't understand what your problem is now.
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
Where is your problem "making the button work"?
Here are some of the steps you need to take:
1) create a button
2) add an actionlistner to the button
3) add the button to the GUI
4) user presses the button
5) the actionlistener method is called
6) get the data to put into the text field
7) put the data in the text field.
Which of the above steps are you having a problem with?
I don't know the source of the data for step 6)
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
Please don't hijack someone else's thread.
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
use getText() method in action listener and then execute SQL's update query using that text.
rushikesh jadha
Junior Poster in Training
89 posts since Dec 2011
Reputation Points: 4
Solved Threads: 11