public String[] getSelectedHosts() {
   Object[] sels = model.getSelectedValues(table);
   String[] vals = new String[sels.length];
   for (int x = 0; x < sels.length; x++) {
     vals[x] = sels[x] + "";
   }
   return vals;
 }
  public void end() {
    final int[] selected = table.getSelectedRows();

    model.clear(rows.size());
    Iterator i = rows.iterator();
    while (i.hasNext()) {
      model.addEntry((Map) i.next());
    }
    rows.clear();

    if (SwingUtilities.isEventDispatchThread()) {
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              model.fireListeners();
              fixSelection(selected);
            }
          });
    } else {
      model.fireListeners();
      fixSelection(selected);
    }
  }