コード例 #1
0
    void populateTable(HashMap data) {
      String key, strval = "<null>";
      Object val;
      int num_rows = 0;
      Map.Entry entry;

      if (data == null) return;
      num_rows = data.size();
      clearTable();

      if (num_rows > 0) {
        for (Iterator it = data.entrySet().iterator(); it.hasNext(); ) {
          entry = (Map.Entry) it.next();
          key = (String) entry.getKey();
          val = entry.getValue();
          if (val != null) strval = val.toString();
          table_model.addRow(new Object[] {key, strval});
        }
        table_model.fireTableRowsInserted(0, num_rows - 1);
        validate();
      }
    }
コード例 #2
0
 @Override
 public void fireTableRowsInserted(int firstRow, int lastRow) {
   super.fireTableRowsInserted(firstRow, lastRow);
 }