I am having trouble deciding how to go about controlling the objects in my application. I want to have a JDesktopPane which when selecting menu options will spawn internal frames. The internal frames should themselves be able to spawn other internal frames.
My question is how is this normally done. Should I create a singleton JDesktopPane with methods in it to spawn every type of internal frame possible, that way it would be easy to get the frames to appear by calling the JDesktopPane instance from anywhere in the application, even from the other internal frames. In other words have the JDesktopPane create all the objects.
Or, should I allow the Internal frames to create the other Internal Frame objects in their methods?
In fact should I be creating the objects in the methods at all or should I be doing that in the constructor, I am getting very confused!?