private void cancelButtonActionPerformed(ActionEvent e) { cont.remove(this); cont.setCurrent(previous); cont.add(cont.getCurrent()); cont.revalidate(); cont.repaint(); }
private void saveButtonActionPerformed(ActionEvent e) { String animal = animalField.getText(); String color = colorField.getText(); String name = nameField.getText(); try { facade.addNewTrial(animal, color, name); } catch (Exception ex) { showError(); ex.printStackTrace(); return; } cont.remove(this); cont.setCurrent(previous); cont.add(cont.getCurrent()); cont.revalidate(); cont.repaint(); }