@Override public void actionPerformed(ActionEvent e) { int aDelete = Integer.parseInt(lastNameField.getText()); System.out.println(); for (int j = 0; j <= array.length; j++) { if (array[j] == t.search(aDelete)) { System.out.println("Deleting " + array[j]); t.delete(array[j]); PrintTree2.printTree(t); System.out.println(array[j] + " has been removed from the tree."); j = array.length; } } clearFields(); }
/** Class to respond to new gallons value. */ public static void printTree() { PrintTree2.printTree(t); }