Divider () { return new OnePixelDivider(isVertical(), this) { @Override public void paint(Graphics g) { final Rectangle bounds = g.getClipBounds(); g.setColor(myTable.getShowVerticalLines() ? myTable.getGridColor() : myTable.getBackground()); g.fillRect(bounds.x, bounds.y, bounds.width, bounds.height); JTableHeader header = myTreeTableHeader; Rectangle rect = header.getHeaderRect(0); g.setClip(rect.x, rect.y, 2, rect.height); g.translate(-rect.width + 1, 0); header.paint(g); } }; }