
Above is the line in JTable (screenshot) with the usual accents specially introduced into it. JTable is ordinary without any special modifications to accommodate or accept special characters.
Accent characters, as defined in: http://tlt.its.psu.edu/suggestions/international/accents/codealt.html
Source:
JTable table = new javax.swing.JTable();
DefaultTableModel model = null;
public void initTableModel() {
model = new DefaultTableModel();
table.setModel(model);
model.addColumn("col1");
model.addColumn("col2");
ListSelectionModel selectionModel = table.getSelectionModel();
selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
ListSelectionModel rowSM = table.getSelectionModel();
table.removeAll();
table.getColumnModel().getColumn((model.getColumnCount() - 1)).setPreferredWidth(200);
}
public void initTableData() {
int numrows = model.getRowCount();
for (int i = numrows - 1; i >= 0; i--) {
model.removeRow(i);
}
String[] row = new String[3];
if (pass != null) {
row[0] = "Lü Dongbin呂洞賓Lán Cǎihé";
row[1] = "《全唐詩》ó, ò, ñ";
model.addRow(row);
}
validate();
repaint();
}
All Java source code: http://ahb.me/1exq (more accurate and verified)
Are these the codes you need?
source
share