private void actionClear() {
   clearing = true;
   tableModel.clearDownload(table.getSelectedRow());
   clearing = false;
   selectedDownload = null;
   updateButtons();
 }
  private void tableSelectionChanged() {

    if (selectedDownload != null) selectedDownload.deleteObserver(DownloadGUI.this);

    if (!clearing && table.getSelectedRow() > -1) {
      selectedDownload = tableModel.getDownload(table.getSelectedRow());
      selectedDownload.addObserver(DownloadGUI.this);
      updateButtons();
    }
  }
 private void actionAdd() {
   URL verifiedUrl = verifyUrl(addTextField.getText());
   if (verifiedUrl != null) {
     tableModel.addDownload(new DownloadFile(verifiedUrl));
     addTextField.setText("");
   } else {
     JOptionPane.showMessageDialog(
         this, "Invalid Download URL", "Error", JOptionPane.ERROR_MESSAGE);
   }
 }