I asked such a question. Do I try to design GUI correctly? Now I am making an application on Swing. There is one JFrame
, setContentPane
of the same JPanel
size is exposed in it. Then another JPanel
is loaded onto this JPanel
by clicking on the button, then certain actions, the last JPanel
disappears, a new one appears, and so on. Imagine the "Next" button. Now I do this: I pass the previous panel to the constructor, then, when I did not need it, I called the method "push and load something else" and so on. I now speak only about the View level.
I was advised today, and why not make the loadable panels Singleton static? This is a good practice, this is the best practice, this is not a good practice? If anyone can, a couple of arguments ...
Thank!