Código:
Y en cada JTable lo aplico de esta manera:public class RenderTabla extends JFormattedTextField implements TableCellRenderer { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { this.setBorder(BorderFactory.createEmptyBorder()); if (value instanceof Double) { Double valor = (Double) value; this.setFormatterFactory(new DefaultFormatterFactory(new NumberFormatter(new DecimalFormat("##,##0.00")))); this.setHorizontalAlignment(SwingConstants.RIGHT); this.setValue(valor); } return this; } }
Código:
tbl_Resultados.setDefaultRenderer(Double.class, new RenderTabla());