This is a question mostly about Java inheritance. I am developing a program which has 2 windows, both of which will be developed in separate classes which will extend JPanel
You can do as below
public class Files extends JPanel{ } public class FileSub1 extends Files{ } public class FileSub2 extends Files{ }