I want to make a pair JTextField/JLabel work as here on StackOverflow, I mean that I want a string to be displayed in JLabel as I write it in JTextField.
I tried adding ActionListener to JTextField but it works only for ENTER. Any ideas?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The DocumentListener should allow you receive updates from a changing text field. I think you just need to override the changeUpdate method. Good luck!
http://docs.oracle.com/javase/6/docs/api/javax/swing/event/DocumentListener.html