From 2bb50e17fb8042503df3350c893552ec622e1e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=99=BD=E4=B8=8E=E5=AD=9F=E6=B5=A9=E7=84=B6?= <1063889643@qq.com> Date: Fri, 15 Sep 2023 00:26:42 +0800 Subject: [PATCH] =?UTF-8?q?+=20=E5=88=86=E6=94=AF=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/light/TutorialApplication.java | 38 +++++++++--------- src/main/resources/icons/git.png | Bin 0 -> 543 bytes 2 files changed, 18 insertions(+), 20 deletions(-) create mode 100644 src/main/resources/icons/git.png diff --git a/src/main/java/com/light/TutorialApplication.java b/src/main/java/com/light/TutorialApplication.java index 3a0ec2c..97bb58e 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 GIT binary patch literal 543 zcmV+)0^t3LP)Px$*-1n}R9HvFm)~u|Fc8M?fB`67fJzNgryy(skD)^VLlhoi6WF2>c_0fkWr5}@ zCzv?+PkaUm-cVwHzx(b!8xWrS!6)lOFhGBk#vP)qD4@W<$vOGRLW&6jsKjAk3sP1f z&dy16;6ktgba5#e2EhgxY|;e~EX|ejA-n-Z<YYLc(+J=e zuVe~@iJJS+na}`y#4CiR3!#JA0Pq*D5b}9ct{<$Ar_gj<0l4B#fRt26#7uOHZcGS^ zwsc$pUe@Uz0b#;$l80qj|}d!ji2 zlp(?D=X10ZZ9wX6O|Gg5Y78M4LI;qrl