@Override public void actionPerformed(ActionEvent e) { this.mainPanel.setVisible(false); if (!this.basicActions(e)) { this.specialAction(e); } Verschluesselung.save(this.user); this.mainPanel.setVisible(true); }
/** * Basis Aktionen fuer die Komponente * * @param e * @return */ private boolean basicActions(ActionEvent e) { if (e.getSource() == this.previous) { if (this.currentPage == 1) { this.previous.setVisible(false); } if (this.currentPage == this.sections.size() - 1) { this.getNext().setVisible(true); this.save.setVisible(false); } this.showPanel.removeAll(); currentPage--; this.showPanel.add(this.sections.get(this.currentPage)); return true; } if (e.getSource() == this.getNext()) { if (this.currentPage == 0) { this.previous.setVisible(true); } if (this.currentPage == this.sections.size() - 2) { this.getNext().setVisible(false); this.save.setVisible(true); } this.showPanel.removeAll(); currentPage++; this.showPanel.add(this.sections.get(this.currentPage)); return true; } if (e.getSource() == this.save) { this.saveOrUpdate(); if (Verschluesselung.save(this.user)) { showSaved(); } return true; } return false; }