feat(ui): 添加应用程序图标支持
为JavaFX桌面应用添加了多尺寸图标支持,提升了用户界面的专业性。移除了未实现的网络上报接口初始化注释。
This commit is contained in:
@@ -3,6 +3,7 @@ package com.fantaibao;
|
|||||||
import com.fantaibao.page.LoginView;
|
import com.fantaibao.page.LoginView;
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
|
import javafx.scene.image.Image;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import javafx.stage.WindowEvent;
|
import javafx.stage.WindowEvent;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
@@ -24,7 +25,6 @@ public class DesktopApplication extends Application {
|
|||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
super.init();
|
super.init();
|
||||||
// todo 初始化应用程序网络上报接口
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -33,6 +33,9 @@ public class DesktopApplication extends Application {
|
|||||||
primaryStage.setTitle("中差评采集工具");
|
primaryStage.setTitle("中差评采集工具");
|
||||||
// 添加窗口关闭事件监听器
|
// 添加窗口关闭事件监听器
|
||||||
primaryStage.setOnCloseRequest(this::handleCloseEvent);
|
primaryStage.setOnCloseRequest(this::handleCloseEvent);
|
||||||
|
// 添加多个尺寸的图标
|
||||||
|
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("/icon16.png")));
|
||||||
|
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("/icon32.png")));
|
||||||
// 直接启动登录界面
|
// 直接启动登录界面
|
||||||
new LoginView(primaryStage);
|
new LoginView(primaryStage);
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
src/main/resources/icon16.png
Normal file
BIN
src/main/resources/icon16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 564 B |
BIN
src/main/resources/icon32.png
Normal file
BIN
src/main/resources/icon32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user