DBE-1035: fix JBTable not using column margin when expanding/collapsing columns

This commit is contained in:
Sergey Savenko
2014-12-24 17:45:31 +03:00
parent 37107e9285
commit b4e905df62
@@ -741,7 +741,8 @@ public class JBTable extends JTable implements ComponentWithEmptyText, Component
TableColumn column = getColumnModel().getColumn(columnToPack);
int currentWidth = column.getWidth();
int expandedWidth = getExpandedColumnWidth(columnToPack);
int newWidth = currentWidth >= expandedWidth ? getPreferredHeaderWidth(columnToPack) : expandedWidth;
int newWidth = getColumnModel().getColumnMargin() +
(currentWidth >= expandedWidth ? getPreferredHeaderWidth(columnToPack) : expandedWidth);
setResizingColumn(column);
column.setWidth(newWidth);