Is it possible to include a jpanel into an container from another java file? Let suppose I have 2 java files fileA.java and fileB.java. And I want to add the entire display content of fileB.java inside a container in fileA.java. Is this possible? Just a confusion running in for a very long time. Thanks in advance.
Is it possible to include a jpanel into an container from another java file?
Share
You could make the other file/cass
extends JPaneland then since it is a JPanel, you can add it to any other file. For example:FileA.java
FileB.java
Or you can simply have a JPanel be a field in another file and access it with a getter method.
Example:
FileC.java