Example #1
0
  /**
   * Used when an existing appointment is opened for editing... Need to init the fields in the
   * dialog box
   *
   * @param parent the owner frame that invokes the dialog box
   * @param title the title of the dialog box
   * @param model whether the box is modal or not
   * @param a used to hold the info of the appointment being edited
   */
  public ApptDialog(MyCalendar parent, String title, String uid1, boolean modal, Appt a) {

    super(parent, "Appointment for " + title, modal);
    initComponents();
    date = title;
    uid = uid1;

    jTextFieldName.setText(a.getName());
    jTextFieldPhone.setText(a.getNumber());

    jComboBoxStartMinutes.setSelectedIndex(a.getStartMinute());
    jComboBoxStartHours.setSelectedIndex(a.getStartHour());
    if (a.isStartPM()) {
      jRadioButtonAM.setSelected(false);
      jRadioButtonPM.setSelected(true);
    } else {
      jRadioButtonAM.setSelected(true);
      jRadioButtonPM.setSelected(false);
    }

    jTextFieldNotes.setText(a.getNotes());
    owner = parent;
    appointment = a;

    setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    // setVisible(true);
  }