Sharing Data Members between two JFrames
I have two classes that extend JFrame, call them frame1 and frame2. Frame1 is basically the main window while frame2 is an "options" window.
Frame1 has a data member called "mystring". It also has a button called "optionsButton" which loads the options window.
In the options window I have yet another button that is called "resetStringButton". When I click on this button, it resets the string "mystring" in frame1, to "".
So basically I want both frames to share mystring. How can I do this? I tried having yet another class that contains the data, and loads both frames. However, I still find it difficult to "share" these members between all these different classes.
Help would be much appreciated.