Java Netbeans Swing

Any expert Java, Netbeans, Swing readers?

if we have a ‘jFrame’ and within that object we have a ‘jPanel’ that contains all its components supporting its layout.

all this is held within a single file, the layout of which appears fixed, no problem.

but if another ‘jPanel’ is required, and it is added to the project using a manager such as CARD LAYOUT and we add a number of components to the new ‘jPanel’ with the intention that both these ‘jPanel’ components are separate and unrelated, except by the ‘jFrame’, is it possible, to hold the components of each ‘jPanel’ in a CLASS that has each ‘jPanel’ component separate from the whole.

I am looking effectively to see if I can recreate the xojo(yes sorry, some stuff in there is a good idea) container class.

right now, when I add anything GUI it all goes in a single great big file with zero separation, not OOPy at all.

You may have to rethink your understanding of oop. Java is completely object oriented. It would be nice if you would publish code. It costs tons of time to read and understand and to mention what you want. With the code it would be less complex.

One way: make a class with your stuffs for the panel and add the instance to a pane in another class. You are standing on your feets in this case. You can generate all time a new class or package with class with gui stuff to add. Oop works sozhat you then need to add the instance.