if ((contentPane.getWidth() == 0) || (contentPane.getHeight() == 0)) { jComponent.doLayout(); jComponent.getRootPane().doLayout(); }
    public Insets getInsets() {        final Container contentPane = jComponent.getContentPane();        if ((contentPane.getWidth() == 0) || (contentPane.getHeight() == 0)) {            jComponent.doLayout();            jComponent.getRootPane().doLayout();        }        final int cpWidth = contentPane.getWidth();        final int cpHeight = contentPane.getHeight();        final Insets insets;        if ((cpWidth > 0) && (cpHeight > 0)) {            insets = new Insets(0, 0, 0, 0);            Component c = contentPane;            while (c != jComponent) {                insets.left += c.getX();                insets.top += c.getY();                c = c.getParent();            }            final int dw = jComponent.getWidth() - contentPane.getWidth();            final int dh = jComponent.getHeight() - contentPane.getHeight();            insets.right = dw - insets.left;            insets.bottom = dh - insets.top;        } else {            insets = jComponent.getInsets();            System.out.println("cp.bounds: " + contentPane.getBounds());        }        return insets;    }