配置jpackage

This commit is contained in:
yang 2022-10-14 08:13:27 +08:00
parent 3b59fc631f
commit c4e35f52c9
7 changed files with 14 additions and 1 deletions

View File

@ -59,6 +59,13 @@ jlink {
launcher { launcher {
name = 'RoomIt' name = 'RoomIt'
} }
jpackage {
applicationName = "RoomIt"
installerType = "exe"
appVersion = project.version
icon = "icon/logo16x16.ico"
description = "开源屏幕画笔工具"
}
} }
jlinkZip { jlinkZip {

BIN
icon/logo16x16.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

View File

@ -4,6 +4,7 @@ import javafx.application.Application;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.paint.Paint; import javafx.scene.paint.Paint;
import javafx.stage.Stage; import javafx.stage.Stage;
import javafx.stage.StageStyle; import javafx.stage.StageStyle;
@ -64,6 +65,8 @@ public class MainWindow extends Application {
stage.setResizable(false); stage.setResizable(false);
// 设置窗口透明 // 设置窗口透明
stage.initStyle(StageStyle.TRANSPARENT); stage.initStyle(StageStyle.TRANSPARENT);
// 设置图标
stage.getIcons().add(new Image(ResourceUtils.getResourceAsStream(GlobalConsts.LOGO_PATH)));
// 将窗口显示出来 // 将窗口显示出来
stage.show(); stage.show();
} catch ( } catch (

View File

@ -3,6 +3,7 @@ package org.rococy.roomit;
import javafx.application.Application; import javafx.application.Application;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.paint.Paint; import javafx.scene.paint.Paint;
import javafx.stage.Screen; import javafx.stage.Screen;
import javafx.stage.Stage; import javafx.stage.Stage;
@ -36,6 +37,8 @@ public class TrayWindow extends Application {
stage.setAlwaysOnTop(true); stage.setAlwaysOnTop(true);
// 取消任务栏 // 取消任务栏
stage.initStyle(StageStyle.TRANSPARENT); stage.initStyle(StageStyle.TRANSPARENT);
// 设置图标
stage.getIcons().add(new Image(ResourceUtils.getResourceAsStream(GlobalConsts.LOGO_PATH)));
// 当没有焦点时关闭 // 当没有焦点时关闭
stage.focusedProperty().addListener((observable, oldValue, newValue) -> { stage.focusedProperty().addListener((observable, oldValue, newValue) -> {

View File

@ -21,7 +21,7 @@ public class GlobalConsts {
/** /**
* logo图标路径 * logo图标路径
*/ */
public static final String LOGO_PATH = "img/logo24x24.png"; public static final String LOGO_PATH = "img/logo32x32.png";
/** /**
* 配置文件路径 * 配置文件路径

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B