posted 7 years ago
Hi everyone!
I would like to ask a question related to passing values between jPanels.
For example, I have a jFrame and 5 jPanels, I am switching jPanels by CardLayout. jPanels have a lot of jTextFields and jComboBoxes.
Every jPanel have saveButton, by clicking saveButton I am getting values from jTextFields and jComboBoxes and writing them into text file.
The layout of text file:
And I get stuck on this part:
if jTextfield3 of jPanel 3 is not empty and have some value, then it must be printed in under jPanel2 values too:
And if jTextfield3 of jPanel 3 is empty, then it must not printed in jPanel2:
I would like to ask how to listen for changes in other jPanels, how to create communication between jPanels which managed by CardLayout?
Any help is greatly appreciated.