第一种
public class Main1 extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("Main1");
primaryStage.show();
}
}
第二种
public class Main2 extends Application {
public static void main(String[] args) {
Application.launch(args);
// 另一个launch形式
// Application.launch(Main2.class, args);
}
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.show();
}
}
第三种
public class Main3 {
public static void main(String[] args) {
Application.launch(Launch.class, args);
}
}
// 两个类分开写
class Launch extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("Main3");
primaryStage.show();
}
}