小编use*_*806的帖子

如何在Windows上为javafx本机程序包图标设置自定义图标

我正在尝试创建exe文件的图标,同时创建javafx打包的本机捆绑.我尝试将图标添加到pom.xml中,但直到它不会为我工作,因为它提供默认图标
使用Intellij IDEA IDE,其中包含一个Pom.xml创建一个包,command = mvn jfx:build-native 这是我的pom.xml:

<build>
    <plugins>
        <plugin>
            <groupId>com.zenjava</groupId>
            <artifactId>javafx-maven-plugin</artifactId>
            <version>1.5</version>
            <configuration>

                <mainClass>com.demoApp.testapp.testApplication</mainClass>

                <!-- only required if signing the jar file -->
                <keyStoreAlias>example-user</keyStoreAlias>
                <keyStorePassword>example-password</keyStorePassword>
                <permissions>
                    <permission>all-permissions</permission>
                </permissions>
                <icon>${basedir}/src/main/resources/images/logoIcon.ico</icon>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>

    </plugins>
</build>
Run Code Online (Sandbox Code Playgroud)

我已经在pom.xml $ {basedir} /src/main/resources/images/logoIcon.ico中添加了一个图标路径,它将在本机程序包执行时运行,但它对我不起作用

还有其他办法吗?请建议.


我使用ant在pom.xml中尝试了fx标签,这是我在pom.xml中的更改

<properties>

<javafx.tools.ant.jar>${env.JAVA_HOME}\lib\ant-javafx.jar</javafx.tools.ant.jar> </properties>


<plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>create-launcher-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target xmlns:fx="javafx:com.sun.javafx.tools.ant">
                                <taskdef
                                        uri="javafx:com.sun.javafx.tools.ant"
                                        resource="com/sun/javafx/tools/ant/antlib.xml"
                                        classpath="${javafx.tools.ant.jar}"/>
                                <fx:application id="fxApp"
                                                name="${project.name}"
                                                mainClass="com.precisionhawk.flightplanner.FlightPlannerApp"/>
                                <fx:jar destfile="${project.build.directory}/${project.build.finalName}-launcher">
                                    <fx:application refid="fxApp"/> …
Run Code Online (Sandbox Code Playgroud)

icons exe native pom.xml javafx-2

8
推荐指数
1
解决办法
1万
查看次数

如何动态更改javafx中滑块中的滑块拇指图标图像?

在fxml文件中有滑块:

Slider fx:id ="slider"minHeight ="20"minWidth =" - Infinity"prefWidth ="300.0"

想要从我的.java类更改滑块拇指图标图像,因为我可以使用更改拇指图标图像 css

.slider .thumb{
 -fx-background-image :url("your image");   
 ...// more customization       
}
Run Code Online (Sandbox Code Playgroud)

但我想从.java类更改图像

请建议..

谢谢

image slider javafx-2

5
推荐指数
1
解决办法
1922
查看次数

标签 统计

javafx-2 ×2

exe ×1

icons ×1

image ×1

native ×1

pom.xml ×1

slider ×1