Whenever I run my program (Which only consists of a JFrame in main and another public void method) it only runs the main method. I know this is the case because when I test System.out.println(“Test”); in the second method it doesn’t execute but if I do the same line of code in main in will execute as expected
package com.route.route;
import javax.swing.JFrame;
import javax.swing.JMenuBar;
public class Window extends JFrame {
private static final long serialVersionUID = 1L;
public void gfsdagfds(){
System.out.println("Hello");
}
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setVisible(true);
frame.setSize(800, 600);
frame.setLocationRelativeTo(null);
frame.setTitle("route UNREALEASED 0.01");
frame.setIconImage(null);
frame.setResizable(false);
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
}
It doesn’t look like you’re calling any other methods. main() is just the entry point into the application. You’ll need to call the method: