Custom Icon on NEWT window tutorial

Posted by Arcaedox on
URL: https://forum.jogamp.org/Custom-Icon-on-NEWT-window-tutorial-tp4031412.html

Have you ever wanted to create a high performance application but you dont know how to change the image icon attribute for the NEWT window? here's how.

1. Create a new folder in your project called img
2. Inside that folder copy the .PNG you want as the icon (I recommend 2 , one large one small)
3. On the first line of main insert the code :

------------------------------------------------------------------------------------------|

System.setProperty("jnlp.newt.window.icons", "img\\icon.png img\\icon.png");

------------------------------------------------------------------------------------------|

This is what I typed for mine, the first argument is the same for everybody, the second argument is specifying where and which photos we would like to use. I only have one in my case so I have specified the same .PNG image file. Run your application again and its should run correctly with no errors. NOTE: WHEN ON WINDOWS REMEMBER TO ESCAPE THE BACKSLASHES AS YOU MAY RECEIVE SOME ERRORS FROM YOUR PREFERRED IDE.

4. Carry on with application development :)

#JavaFTW!
#Java-8!

Arcaedox.tk