Custom Icon on NEWT window tutorial

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Custom Icon on NEWT window tutorial

Arcaedox
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
Reply | Threaded
Open this post in threaded view
|

Re: Custom Icon on NEWT window tutorial

gouessej
Administrator
Hi

"newt.window.icons" should be enough. This kind of information should be put into the wiki.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Custom Icon on NEWT window tutorial

Arcaedox
Yeah I agree
Reply | Threaded
Open this post in threaded view
|

Re: Custom Icon on NEWT window tutorial

slajar
In reply to this post by gouessej
Hey Julien,

the icon behaviour of NEWT seems to be pretty awkward. We have our swing based application where we integrated newt for fullscreen bug fixes. Whenever we launch the NEWT window it changes the icon of the entire application (App on Macosx). Can I suppress the icon change somewhere?

regards
Matthias
Reply | Threaded
Open this post in threaded view
|

Re: Custom Icon on NEWT window tutorial

gouessej
Administrator
Hi

Oops, I think you'll have to fill a bug report because I'm almost sure that there is no easy way to work around this limitation. I didn't notice it as my zipped .app bundle runs a fullscreen game.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Custom Icon on NEWT window tutorial

Sven Gothel
Administrator
In reply to this post by slajar
On 08/18/2014 10:44 AM, slajar [via jogamp] wrote:
> Hey Julien,
>
> the icon behaviour of NEWT seems to be pretty awkward. We have our swing based
> application where we integrated newt for fullscreen bug fixes. Whenever we
> launch the NEWT window it changes the icon of the entire application (App on
> Macosx).

Workaround: Set same icon (PNG) w/ NEWT via system properties
  'newt.window.icons' w/ space separated PNG file list,
  see NewtFactory.

AFAIK we have a thread about it here.

> Can I suppress the icon change somewhere?

If required, we need to add this 'feature',
as Julien suggested, pls make a bug report.

Maybe you can use an empty list for above property,
but I have not tried this.

~Sven



signature.asc (828 bytes) Download Attachment