errorPopup= popFactory.getPopup(this, errorBox,
(verifierTopComponent.super.getX()+verifierTopComponent.super.getWidth()/2),
(verifierTopComponent.super.getY()+verifierTopComponent.super.getHeight()/2));
The code above works, and properly centers the popup… but only if the window is fullscreen, on my main monitor.
How do I make it more robust? I’d like to center it in the middle of the current RCP instance.
(verifierTopComponent is my incorrectly named TopComponent in the module).
After the comment below, I’m wondering if maybe y’all typically use a vastly different method to create a popup? I’m just trying to put something in the user’s face to let them know why things won’t work as they have done them.
When using the NetBeans RCP you should rather use DialogDisplayer and DialogDescriptor
Something like this:
It will automatically take care of calculating the correct position.