@Override
	public void actionPerformed(ActionEvent e) {
		if (e.getSource().equals(mat)) {
			String selected = mat.getText();
			Materie materie_noua = null;
			for (Materie m : Centralizator.getInstance().getMaterii()) {
				if (m.getNume().equals(selected)) {
					materie_noua = m;
					return;
				}
			}

			if (materie_noua == null) {
				mesaj.setText("Materia nu exista in baza de date a liceului; verificati inca o data");
				return;
			}
			secretar.modifyMateriePentruProfesor(selectedProfesor, materie_noua);
		} else if (e.getSource().equals(adaugaMaterie)) {
			if (!mat.getText().isEmpty()) {
				JOptionPane
						.showMessageDialog(this,
								"Profesorul are deja materie; stergeti materia mai intai");
				//
				return;
			}
			dispose();
			new SecretarAddMaterie(secretar, selectedProfesor);
		} else if (e.getSource().equals(stergeMaterie)) {
			secretar.removeMateriePentruProfesor(selectedProfesor);
			mat.setText("");
		} else if (e.getSource().equals(back)) {
			dispose();
			Centralizator cen2 = Centralizator.getInstance();
			cen2.saveCentralizator();
			new SecretarMeniu(secretar);
		}
	}