Java Swing - Jtable Text Alignment And Column W... -

The numbers were perfectly right-aligned. The dollar signs lined up like soldiers on parade. The quantities were crisp and flush to the right.

"It looks like a ransom note," his project manager, Lena, had said that morning. "A very boring, very misaligned ransom note." Java Swing - JTable Text Alignment And Column W...

It wasn't modern. It wasn't glamorous. But when Lena saw the working table the next morning, her simple "Oh, that looks perfect" was the only reward he needed. The numbers were perfectly right-aligned

DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer(); rightRenderer.setHorizontalAlignment(SwingConstants.RIGHT); for (int i = 0; i < table.getColumnCount(); i++) table.getColumnName(i).equals("Price")) table.getColumnModel().getColumn(i).setCellRenderer(rightRenderer); "It looks like a ransom note," his project

The table itself was simple. It displayed a list of product orders for "QuickShip Logistics," a client whose patience was wearing thin. The data was perfect. The backend was solid. But the presentation? It was a crime against visual design.

blank