Align the values of the cells in JTable?

后端 未结 7 838
闹比i
闹比i 2020-12-18 18:28

I\'m not aware of how to align the values of cells in JTable.

For Ex,The Jtable shows, Name Salary Mr.X 100000.50 XXXX 234.34

7条回答
  •  悲哀的现实
    2020-12-18 19:06

    The way to go about it is to specify a custom cell renderer for each column. Each renderer will format that data differently (names will e aligned to the left, decimals to the right, ...)

提交回复
热议问题