Rectangle (AbstractButton button) { Rectangle result = new Rectangle(button.getSize()); JBInsets.removeFrom(result, JBUI.insets(1, 0, 1, 1)); int bw = BW.get(); //noinspection UseDPIAwareInsets JBInsets.removeFrom(result, new Insets(bw, 0, bw, bw)); return result; }