Page 1 of 1

Center screen before showing?

PostPosted: Tue Mar 28, 2017 4:23 pm
by johnit
Is it possible to center the screen before it will be shown?

Calling center() in constructor didn't work

Re: Center screen before showing?

PostPosted: Tue Mar 28, 2017 4:25 pm
by Support@SIB
center() doesn't work in constructor because the frame isn't available at this time.

You should override onActivate:

Code: Select all
@Override
public void onActivate() throws Throwable
{
    super.onActivate();

    center();
}


The screen is only the content and doesn't know anything about the representation (frame, embedded, ...). Usually it's a simple panel.