JTable セルの値を変更するこのレンダラーがあります。
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
String label = value.toString();
if(label.equals("-")
label = "error";
setValue(label);
return this;
}
テーブルのデータ モデルでは、行 1、列 2 のデータは「-」
JTable GUI では、行 1、列 2 のデータは「エラー」です
このコードは、データ モデルの値を出力します: "-"。
System.out.println(table.getValueAt(1, 2).toString());
値「エラー」を取得する簡単な方法はありますか?