Search code examples
jtextfield

tow jtextfiled Addition to another Jtextfilde immeditly without action button


I create Jframe with 3 Jtextfield

1-first value

2-second value

3-result

I need make operation between first value and second value to result without any button just once I insert number in the second value the result show immediately


Solution

  • Use DocumentListener in JTextField document to catch events. the document is taken to JTextField::getDocument()