When i started developping my application, I just developped Seprate JFrame frames and test them one by one. Now, i want to make a main window for my app. I read a lot, but until now, it's difficult for me to do this in java and swing. I tried this by creating a main window as an instance of JFrame, but i got errors that shows i can't show JFrame inside another JFrame.
public class MainWindow extends JFrame{
private JFrame frame1;
private JFrame frame2;
public MainWindow(){
frame1 = new JFrame();
frame2 = new JFrame();
setLayout(new BorderLayout());
add(frame1,BorderLayout.CENTER);
add(frame2,BorderLayout.NORTH);
pack();
}
}