Tag Archives: TableCellRenderer

How to format numbers in a JTable with a NumberCellRenderer

NumberCellRendererDemo

By default, the JTable show the cell values as regular text using a JLabel. To display numbers properly, you are force to pre-format the number as string values before setting them in the table model. There is a better way, by using your own implementation of TableCellRenderer. This will allow you to store the values in their intrinsic form inside the table model.

READ MORE »