I have created the buttons for on-screen keyboard. The only thing I don't know is how to add the corresponding letter/character via actionListener to the jTextField. I know if it was not jTextField I could use "append".
enakta13 -3 Newbie Poster
Recommended Answers
Jump to PostYou can use getText() to get the existing text in the text field, then append your new character, then use setText() to update the field.
Jump to PostYou an use the two methods James gave you to accomplish that:
if(e.getSource() == aButton) { //get text already in your text field //add a to that //put text back in text field }
All 5 Replies
code739 17 Posting Whiz in Training
enakta13 -3 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
enakta13 -3 Newbie Poster
Krokcy 14 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.