I would like to add a right-padding to a JTable column, is it possible?
问题 I want to add right cell-padding to a column in my JTable, how do I do it? I tried searching online but I can't seem to find a definitive answer for this. I hope someone can help me. Regards, Chad 回答1: Use a custom TableCellRenderer , and specify setHorizontalAlignment(JLabel.RIGHT) . There's a related example here that illustrates JLabel.CENTER . Addendum: My problem is padding and not alignment . If you want the padding inside the cell, rather than between cells, you can use a border in the