初始化提交

This commit is contained in:
2025-11-10 13:44:57 +08:00
commit ab51b767f8
20 changed files with 763 additions and 0 deletions
@@ -0,0 +1,14 @@
package dev.bytevibe.hyperpoint;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
public class HelloController {
@FXML
private Label welcomeText;
@FXML
protected void onHelloButtonClick() {
welcomeText.setText("Welcome to JavaFX Application!");
}
}
@@ -0,0 +1,9 @@
package dev.bytevibe.hyperpoint;
import javafx.application.Application;
public class Launcher {
public static void main(String[] args) {
Application.launch(Main.class, args);
}
}
@@ -0,0 +1,35 @@
package dev.bytevibe.hyperpoint;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import java.awt.desktop.AppForegroundListener;
import java.io.IOException;
public class Main extends Application {
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
Group root = new Group();
Scene scene = new Scene(root, Color.GRAY);
primaryStage.setScene(scene);
// 设置主要窗口的属性
Image icon = new Image(getClass().getResourceAsStream("icon.png"));
primaryStage.getIcons().add(icon);
primaryStage.setTitle("HyperPoint");
primaryStage.setWidth(800);
primaryStage.setHeight(600);
primaryStage.setResizable(false);
primaryStage.show();
}
}
+9
View File
@@ -0,0 +1,9 @@
module dev.bytevibe.hyperpoint {
requires javafx.controls;
requires javafx.fxml;
requires java.desktop;
opens dev.bytevibe.hyperpoint to javafx.fxml;
exports dev.bytevibe.hyperpoint;
}
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.Button?>
<VBox alignment="CENTER" spacing="20.0" xmlns:fx="http://javafx.com/fxml"
fx:controller="dev.bytevibe.hyperpoint.HelloController">
<padding>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0"/>
</padding>
<Label fx:id="welcomeText"/>
<Button text="Hello!" onAction="#onHelloButtonClick"/>
</VBox>
Binary file not shown.

After

Width:  |  Height:  |  Size: 939 KiB