JavaFx:2、application的启动方式和生命周期


package fx.com;

import javafx.application.Application;
import javafx.stage.Stage;

public class Main3 extends Application {
    public static void main(String[] args) {
        System.out.println("Main():"+Thread.currentThread().getName());
        Application.launch(Main3.class,args);
    }

    @Override
    public void init() throws Exception {
        System.out.println("Init():"+Thread.currentThread().getName());
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        System.out.println("Start():"+Thread.currentThread().getName());
        primaryStage.setTitle("Hello World");
        primaryStage.show();
    }

    @Override
    public void stop() throws Exception {
        System.out.println("Stop():"+Thread.currentThread().getName());
    }
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM