Add a viewportBorder property like JScrollPane and take into account the viewportBorder (which only some LAFs have) separately from the border.