diff --git a/src/main/java/com/light/TutorialApplication.java b/src/main/java/com/light/TutorialApplication.java index 3a0ec2c433ed2f952b358df80ee9973680a54d43..97bb58e37528e65876828189de53250a4bb3e66d 100644 --- a/src/main/java/com/light/TutorialApplication.java +++ b/src/main/java/com/light/TutorialApplication.java @@ -3,45 +3,43 @@ package com.light; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; -import javafx.scene.layout.StackPane; +import javafx.scene.image.Image; +import javafx.scene.layout.*; +import javafx.scene.paint.Color; import javafx.scene.text.Font; import javafx.stage.Stage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * TODO 例子,后续移除 */ public class TutorialApplication extends Application { - public static final Logger LOGGER = LoggerFactory.getLogger(TutorialApplication.class); - private static final Logger COMMON_LOGGER = LoggerFactory.getLogger("COMMON"); - public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { - String javaVersion = System.getProperty("java.version"); - String javafxVersion = System.getProperty("javafx.version"); // label - Label l = new Label("Hello, JavaFx " + javafxVersion + ", running on Java " + javaVersion + "."); + Label l = new Label("Hello"); l.setFont(Font.font(20)); - // stackpane - StackPane stackPane = new StackPane(); - stackPane.getChildren().add(l); - Scene scene = new Scene(stackPane, 640, 480); + BorderPane root = new BorderPane(l); + + root.setTop(getPane("blue")); + root.setLeft(getPane("green")); + + Scene scene = new Scene(root, 1096, 768); + stage.setTitle("Git批量管理工具"); + stage.getIcons().add(new Image(this.getClass().getResource("/icons/git.png").toExternalForm())); stage.setScene(scene); stage.show(); + } - LOGGER.info("这是info日志"); - LOGGER.error("这是error日志"); - LOGGER.warn("这是warn日志"); - LOGGER.debug("这是debug日志"); - COMMON_LOGGER.info("这是common的info日志"); - COMMON_LOGGER.warn("这是common的warn日志"); - COMMON_LOGGER.debug("这是common的debug日志"); + public Pane getPane(String color) { + Pane pane = new Pane(); + pane.setPrefSize(100.0, 100.0); + pane.setStyle("-fx-background-color: " + color); + return pane; } } diff --git a/src/main/resources/icons/git.png b/src/main/resources/icons/git.png new file mode 100644 index 0000000000000000000000000000000000000000..7130108e07fd7d94c20eb4c3d62171adbbad79b6 Binary files /dev/null and b/src/main/resources/icons/git.png differ