protected void centerOnClientArea() {
        Rectangle clientArea = shell.getDisplay().getPrimaryMonitor().getClientArea();
        Point shellSize = shell.getSize();
        int xPos = clientArea.x + (clientArea.width - shellSize.x) / 2;
        int yPos = clientArea.y + (clientArea.height - shellSize.y) / 2;
        if (xPos >= 0 && yPos >= 0) {
            shell.setLocation(xPos, yPos);
        } else {
            shell.setLocation(0, 0);
        }
    }