private void myInit() {
        if (!editing) {
            EdentButton buttonAction = editing
                    ? new EdentButton(BUTTON_DELETE_LABEL, BUTTON_SIZE, BUTTON_FONT_SIZE, EdentButtonColor.red, BorderLayout.CENTER)
                    : new EdentButton(BUTTON_SAVE_LABEL, BUTTON_SIZE, BUTTON_FONT_SIZE, EdentButtonColor.green, BorderLayout.CENTER);

            buttonAction.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    if (editing) {
                        if (ViewController.showConfirmDialog(DELETE_CONFIRM_TEXT, DELETE_CONFIRM_TITLE)) {
                            ViewController.modelFacade().deleteAppointment(apptId);
                            ViewController.showPrevious();
                        }
                    } else {
                        String note = (textNote.getText().equals(NOTE_TEXT))?"":textNote.getText();
                        long bdate = TimeFormatter.getAppointmentDate(textDate.getText());
                        long patientId = getPatientId();

                        //String icon = picChooser.getSelectedFile().getAbsolutePath(); //TODO file checking and copying
                        if (bdate != -1 && patientId > -1) {
                            ViewController.modelFacade().createAppointment(bdate, note, patientId);
                            ViewController.showPrevious();
                            ViewController.refreshAppts();
                        } else if(patientId==-1){
                            System.out.println("Patient not selected");
                            labelPatient.setForeground(Color.red);
                        } else{
                            System.out.println("Date not specified or in wrong format");
                        }
                    }
                }
            });

            this.buttonWrap.add(buttonAction);
        }
    }