JButton to JTextField | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

JButton to JTextField

Please guys how can I program a JButton to continually input text inside a JTextField. Like if I press a button "1" and press it again it should continually writ into a JTextField. It ulgent please.

1st May 2020, 8:54 PM
3 Answers
+ 4
Write an action listener for the button. Every time user clicks the button, you set the text field equal to whatever you got from Jtextfield.
1st May 2020, 9:08 PM
Jay W
+ 2
Yes it had been done but anytime the button is click twice or more, it will alone type it once into the JTextField. Please help me!
3rd May 2020, 1:12 PM
If you need help, you should try to post part of your code, so we can see what's wrong
3rd May 2020, 9:59 PM
Jay W