Reputation: 1715
Like the title says, is there a simple way to change the width of the gridlines in JTable?
I found out, that there is a simple way to change the color of the showed gridlines in the Jtable but I could not find any methods to change the gridline width.
Upvotes: 1
Views: 2197
Reputation: 775
One of the ways is to override the prepareRenderer(...) method of JTable class, using BorderFactory to create custom border:
JTable table = new JTable( model ) {
public Component prepareRenderer( TableCellRenderer renderer, int row, int column) {
JComponent jc = (JComponent)super.prepareRenderer(renderer, row, column);
jc.setBorder(BorderFactory.createLineBorder(Color.BLACK, 3));
return jc;
}
};
Upvotes: 2