James_Duh
James_Duh

Reputation: 1371

Javafx 8 NetBeans titlebar icon with native packaging

I need some help with NetBeans and a JavaFX project When I try to install an icon in the title bar of a Windows 7 Desktop application it will not show up Here are the steps I have used to create and EXE file Main Class adds the icon with this line of code that works in Eclipse pStage.getIcons().add(new Image(“file:src/Photos/C.ico”)); Inno Setup 5.0 installed and in Path the icon is 32 by 32 and 32 bit depth it was created with GreenFish Icon maker the icon is under Source Package in a folder named Photos right click project select Properties select Deployment check Enable Native Packaging set the path to the icon for Native Package Icons src/Photos/C.ico Run Clean and Build Run Package As EXE

The only other concern I have is this output message No base JDK Package will use system JRE I see this as a separate issue so as a bonus question can I ask for help with how to include the JDK or JRE so this application is independent of what JRE if any is installed on the end user machine.

A side note during development if I use C.bmp in place of the ico file the title bar will display the bmp. The bmp file will not work at build time.

Upvotes: 0

Views: 460

Answers (1)

Vector
Vector

Reputation: 3235

@James_Duh I have no idea why this works and I doubt you find this FIX anywhere else as I searched the net for why you need to use a bmp and ico file Here is what I did with NetBeans 8.0.? and JDK1.8.0_51 on Windows 7 in the Main.class I used this line of code

Image ico = new Image("Photos/C.bmp"); NetBeans
Image ico = new Image("file:Photos/C.bmp"); Eclipse

Then in the Photos folder I placed an icon named C.ico 32 by 32 this icon is used to populate the installer EXE file which when you run the EXE file the icon will be displayed in the Start Menu I also checked Desktop Icon and Start Menu shortcut under Deployment in NetBeans Deployment screen

The Native Package deployment process in Eclipse is a real real PAIN In the future I will make the switch to NetBeans IDE for this reason alone

Upvotes: 0

Related Questions