Rectangle () { JTextComponent c = getComponent(); Rectangle bounds = new Rectangle(c.getSize()); JBInsets.removeFrom(bounds, c.getInsets()); JBInsets.removeFrom(bounds, c.getMargin()); return bounds; }