_risk_icon = new ImageIcon(getClass().getResource("/info-icon.png")) This.low_risk_icon = new ImageIcon(getClass().getResource("/low-icon.png")) dium_risk_icon = new ImageIcon(getClass().getResource("/medium-icon.png")) This.high_risk_icon = new ImageIcon(getClass().getResource("/high-icon.png")) This.critical_risk_icon = new ImageIcon(getClass().getResource("/critical-icon.png")) Adding this to the “pom.xml” file resulted in a self-contained single jar file with all resources: The simplest route I found was to use the “maven-assembly-plugin”. To fix the wonky icons I needed to ensure the resources were included inside the Jar file or otherwise copied during the build. Bundling the app and dependencies into a single Jar #Netbeans maven codeI wrapped the code loading these icons in a “try catch” statement to see a more verbose error message and to ensure the app loaded despite the wonky icons. The only thing that did not seem to work was the resources folder including the risk icons. Vectors survive for now.īy the end of this my application compiled and executed. Some day the rug will be pulled but for now we are golden. I did not massively feel the need to redo the code for that since it has Vectors in pretty much every single area of the application. Given the age of ReportCompiler there were a few deprecation warnings around the use of Vectors etc. Repeat until all the red underlines have vacated your project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |