Hi, i found this site while searching for solution on google. I've found topic with question very similar to mine, however it didn't help me (
https://coderanch.com/t/416900/java/java/set-TextField-value-another-class).
Ok, so I've got three classes:
1 (Display)- with TextField, that extends JPanel
2 (Cancel) - with Button, that extends JPanel
3 - with final GUI, which extends JFrame
I run my program from "third" class, i see TextField and button. After I click Button i want my TextField to be updated. I made this ActionListener
It invokes method setResult, which I defined in first - Display class
Console shows me "0.0" as I wanted, but value in TextField doesn't change. I'm completely out of ideas how to solve it. I tried to run action listener like
but it didn't help neither.
I hope that Someone will help me with this. I've tried to solve this for 3 hours :S