I have this problem: I have an ArrayList
that contains a few items that I want to use in a particular frame, the problem is that the array list gets full by initializing it in the main class of my project. In this class I also launch my starting frame that is chained with other frames (login frame -> middle frame --> last frame). I want to carry this ArrayList
without having to carry it on through all frames and get it directly usable from main --> last frame. How can I do this?
EDIT
Wat I did it was like first frame start with this ArrayList
as parameter:
Jframe jf = new LoginFrame(arraylistvariable,"Login Window");
Then in all ActionListener
calls on the buttons that create new frames, disposing old ones, I set it like:
Jframe jo = new MiddleFrame(arraylistvariable,"Middle Window");
Passing this variable all over the frames but I want this to be like called only by the frame that needs this, because login frame doesn't need this variable. However, it is necessary to start the program by the login frame.