@Override
	public void actionPerformed(ActionEvent e) {
		Object o = e.getSource();
		if (o instanceof JButton) {
			if (((JButton) o).equals(adauga_absenta)) {
				String nume_prenume = elev_selectat.getNume() + " "
						+ elev_selectat.getPrenume();
				getElevAndClasa(nume_prenume, profesor.getSelectedClasa()
						.getIdClasa());
				String data_de_formatat = an.getSelectedItem().toString() + "-"
						+ luna.getSelectedItem().toString() + "-"
						+ zi.getSelectedItem();
				String tipul_absentei = tip_absenta_de_adaugat
						.getSelectedItem().toString();
				TipAbsenta tip_real = null;
				switch (tipul_absentei) {
				case "motivata":
					tip_real = TipAbsenta.motivata;
					break;
				case "nemotivata":
					tip_real = TipAbsenta.nemotivata;
					break;
				case "nedeterminat":
					tip_real = TipAbsenta.nedeterminat;
					break;
				}
				Date d = null;
				try {
					SimpleDateFormat form = new SimpleDateFormat("yyyy-MM-dd");
					d = form.parse(data_de_formatat);
				} catch (Exception ex) {
					ex.printStackTrace();
				}
				String[] arr_data = d.toString().split(" ");
				String data_de_adaugat = arr_data[0] + "-" + arr_data[1] + "-"
						+ arr_data[2];
				if (!map_abs.containsKey(data_de_adaugat)) {
					profesor.addAbsenta(elev_selectat, tip_real, d);
					addRow(tip_real, d);
					map_abs.put(data_de_adaugat, tip_real.toString());
				} else {
					JOptionPane.showMessageDialog(this,
							"Exista deja o absenta pe data respectiva");
					return;
				}

			} else if (e.getSource().equals(back)) {
				dispose();
				Centralizator cen2 = Centralizator.getInstance();
				cen2.saveCentralizator();
				new ProfesorEditare(profesor);
			}
		}
	}