I'm trying to make a GUI, and I can accomplish it all in one method, but I would like to make the code simpler and make multiple methods. However, I can't get it to work. I am new to Java programming.
public class Main {
public static void main(String[] args) {
FirstWindow fw = new FirstWindow();
fw.setVisible(true);
fw.setSize(600,400);
}
}
public class FirstWindow extends JFrame {
public FirstWindow() {
checkbox c = new checkbox();
c();
}
}
public class checkbox extends JFrame {
public checkbox() {
//code
}
}