主程序 JianShuApp.java
package com.soft1841.sample5;
import com.soft1841.sample4.SingerApp;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import java.net.URL;
public class JianShuApp extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
URL location = getClass().getResource("jianshu.fxml");
FXMLLoader fxmlLoader = new FXMLLoader(location);
Parent root = fxmlLoader.load();
Scene scene = new Scene(root, 800, 600);
scene.getStylesheets().add(JianShuApp.class.getResource("jianshu.css").toExternalForm());
primaryStage.setTitle("简书");
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}