| Author |
Java: Concatenating Text in a JTextbox using JButtons?
|
Nathe Chan
Ranch Hand
Joined: Mar 12, 2009
Posts: 33
|
|
Hi everyone,
I am stuck on Java. I have a JPasswordField, and I need to know how to solve this scenario. If I press JButtons on my box, they should be concatenated onto the textbox. What if I had JButtons named 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', and 'J'. How would I enter the JButtons to form a character password string such as 'C','H','A','A'? Can someone provide with the code to solve my problem? Sincerely, I do not have much time left on my hands and I need an answer ASAP.
Thank you very much,
Nathe
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
|
Each time you press a button, get the existing text in the text field. Then append the new text onto it. Then set the text + new text back on the text field.
|
 |
 |
|
|
subject: Java: Concatenating Text in a JTextbox using JButtons?
|
|
|