Re: Centering a Newt window?
Posted by
Sven Gothel on
Oct 15, 2012; 10:36pm
URL: https://forum.jogamp.org/Centering-a-Newt-window-tp4026458p4026504.html
On 10/16/2012 12:30 AM, adi [via jogamp] wrote:
> I also have had that problem, if i use GLWindow.
>
> First after a setVisible(true) the correct screen coordinates can
> get from getScreen().getWidth() and getScreen().getHeight(),
> so i must use
> Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
>
You can also create a NEWT Screen via NEWT factory
and force it's instantiation by issuing 'addReference()' !
This is due to our lazy initialization ..
You then can reuse that Screen instance for GLWindow,
after which initialization (setVisible() )
I would 'removeReference()' to give the GLWindow
the 'right' to destroy it later on.
~Sven