Пример #1
0
 public String getColumnName(int columnIndex) {
   String answer = null;
   if (columnIndex < 0 || columnIndex >= columnModel.getColumnCount()) {
     return answer;
   }
   Object value = columnModel.getColumn(columnIndex).getHeaderValue();
   if (value != null) {
     return value.toString();
   }
   return answer;
 }
Пример #2
0
 public void setValueAt(Object value, int rowIndex, int columnIndex) {
   List rows = getRows();
   if (rowIndex < 0 || rowIndex >= rows.size()) {
     return;
   }
   if (columnIndex < 0 || columnIndex >= columnModel.getColumnCount()) {
     return;
   }
   Object row = getRows().get(rowIndex);
   rowModel.setValue(row);
   DefaultTableColumn column = (DefaultTableColumn) columnModel.getColumn(columnIndex);
   if (row == null || column == null) {
     return;
   }
   column.setValue(row, value, rowIndex, columnIndex);
 }
Пример #3
0
 public Object getValueAt(int rowIndex, int columnIndex) {
   List rows = getRows();
   Object answer = null;
   if (rowIndex < 0 || rowIndex >= rows.size()) {
     return answer;
   }
   if (columnIndex < 0 || columnIndex >= columnModel.getColumnCount()) {
     return answer;
   }
   Object row = getRows().get(rowIndex);
   rowModel.setValue(row);
   DefaultTableColumn column = (DefaultTableColumn) columnModel.getColumn(columnIndex);
   if (row == null || column == null) {
     return answer;
   }
   return column.getValue(row, rowIndex, columnIndex);
 }
Пример #4
0
 protected ValueModel getColumnModel(int columnIndex) {
   DefaultTableColumn column = (DefaultTableColumn) columnModel.getColumn(columnIndex);
   return column.getValueModel();
 }