jtable - 如何设置列之间的差距

Bic*_*ick 2 swing jtable

有没有办法在JTable列或行之间添加间隙?(不使用单元格渲染器)

kle*_*tra 11

查看setIntercellSpacing和/或setRow/ColumnMargin.好的,查找方法:

// set gap between rows, api in JTable
table.setRowMargin(int)
// set gap between columns, api in TableColumnModel
table.getColumnModel().setColumnMargin(int)
// convenience for setting both row and column gaps
table.setIntercellSpacing(Dimension) 
Run Code Online (Sandbox Code Playgroud)