I am trying to create a basic Java program to help me learn java better so I apologize if this is a noob question but I've been doing a lot of research and just haven't found a solid answer that I can understand
I have heard a lot that it is a bad practice to use multiple JFrames, and that isn't exactly what I want anyway. I want to have a 'home screen' that has a few buttons on it that would each take me to a different view but then of course remove all of what was on the home screen. So should I have my main class like this?:
package buildeditor;
public class BuildEditor {
public static void main(String[] args) {
MainFrame main = new MainFrame(400, 400);
}
}
And then have package buildeditor;
import javax.swing.*;
public class MainFrame extends JFrame {
public MainFrame(int height, int width){
setSize(height, width);
setVisible(true);
}
}
And then where should I put all of the different panels and then call them individually so that when I call a new one, the old one goes away and this new one takes over the whole JFrame.