Ejemplo n.º 1
0
 private void actionClear() {
   clearing = true;
   tableModel.clearDownload(table.getSelectedRow());
   clearing = false;
   selectedDownload = null;
   updateButtons();
 }
Ejemplo n.º 2
0
  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();
    }
  }
Ejemplo n.º 3
0
 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);
   }
 }