use of javax.swing.table.TableColumnModel in project otapij by FellowTraveler.
the class NYMBoxTableModel method setValue.
public void setValue(Map values, JTable nymBox) {
clearValue();
Set set = values.keySet();
Iterator iterator = set.iterator();
int i = 0;
data = new Object[values.size()][];
while (iterator.hasNext()) {
String key = (String) iterator.next();
String[] row = (String[]) values.get(key);
String[] tableData = new String[6];
for (int j = 0; j < tableData.length; j++) tableData[j] = row[j];
data[i] = tableData;
i++;
}
/*RowSorter<TableModel> sorter =
new TableRowSorter<TableModel>(this);
nymBox.setRowSorter(sorter);*/
TableColumnModel tcm = nymBox.getColumnModel();
System.out.println("col count:" + tcm.getColumnCount());
if (tcm.getColumnCount() == 6) {
nymBox.removeColumn(tcm.getColumn(5));
}
if (tcm.getColumnCount() == 5) {
nymBox.removeColumn(tcm.getColumn(4));
}
if (tcm.getColumnCount() == 4) {
nymBox.removeColumn(tcm.getColumn(3));
}
fireTableDataChanged();
}
use of javax.swing.table.TableColumnModel in project otapij by FellowTraveler.
the class NYMOutboxTableModel method setValue.
public void setValue(Map values, JTable nymOutBox) {
clearValue();
Set set = values.keySet();
Iterator iterator = set.iterator();
int i = 0;
data = new Object[values.size()][];
while (iterator.hasNext()) {
String key = (String) iterator.next();
String[] row = (String[]) values.get(key);
System.out.println("row len:" + row.length);
String[] tableData = new String[6];
for (int j = 0; j < tableData.length; j++) tableData[j] = row[j];
data[i] = tableData;
i++;
}
/* RowSorter<TableModel> sorter =
new TableRowSorter<TableModel>(this);
nymOutBox.setRowSorter(sorter);*/
TableColumnModel tcm = nymOutBox.getColumnModel();
if (tcm.getColumnCount() == 6) {
nymOutBox.removeColumn(tcm.getColumn(5));
}
if (tcm.getColumnCount() == 5) {
nymOutBox.removeColumn(tcm.getColumn(4));
}
if (tcm.getColumnCount() == 4) {
nymOutBox.removeColumn(tcm.getColumn(3));
}
fireTableDataChanged();
}
use of javax.swing.table.TableColumnModel in project otapij by FellowTraveler.
the class NYMTableModel method removeCols.
public static void removeCols(JTable nymTable) {
TableColumnModel tcm = nymTable.getColumnModel();
System.out.println("getColumnCount:" + tcm.getColumnCount());
if (tcm.getColumnCount() == 2) {
nymTable.removeColumn(tcm.getColumn(1));
}
}
use of javax.swing.table.TableColumnModel in project otapij by FellowTraveler.
the class BitcoinSentTableModel method setValue.
public void setValue(Map values, JTable sentTable) {
clearValue();
System.out.println("values.size():" + values.size());
Set set = values.keySet();
Iterator iterator = set.iterator();
int i = 0;
data = new Object[values.size()][];
while (iterator.hasNext()) {
String key = (String) iterator.next();
String[] row = (String[]) values.get(key);
data[i] = row;
i++;
}
/*RowSorter<TableModel> sorter =
new TableRowSorter<TableModel>(this);
accountTable.setRowSorter(sorter);*/
TableColumnModel tcm = sentTable.getColumnModel();
System.out.println("sentTable.getColumn()" + tcm.getColumnCount());
if (tcm.getColumnCount() == 6) {
sentTable.removeColumn(tcm.getColumn(5));
}
fireTableDataChanged();
}
use of javax.swing.table.TableColumnModel in project otapij by FellowTraveler.
the class CheckBoxEditorCell method setValue.
public void setValue(Map values, JTable cashPurseTable) {
clearValue();
System.out.println("In cash purse table mode---set values size:" + values.size());
Set set = values.keySet();
Iterator iterator = set.iterator();
int i = 0;
data = new Object[values.size()][columnNames.length];
while (iterator.hasNext()) {
String key = (String) iterator.next();
String[] row = (String[]) values.get(key);
System.out.println("row len:" + row.length);
Object[] tableData = new Object[columnNames.length];
for (int j = 0; j < row.length; j++) {
tableData[j] = row[j];
}
tableData[5] = Boolean.FALSE;
tableData[6] = key;
data[i] = tableData;
i++;
}
/*RowSorter<TableModel> sorter =
new TableRowSorter<TableModel>(this);
cashPurseTable.setRowSorter(sorter);*/
TableColumnModel tcm = cashPurseTable.getColumnModel();
System.out.println("cash purse getColumn() count:" + tcm.getColumnCount());
if (tcm.getColumnCount() == 7) {
cashPurseTable.removeColumn(tcm.getColumn(6));
}
fireTableDataChanged();
}
Aggregations