private void loadData(TrainingClass trainingClass) {
        if (UserSession.getDebug()) {
            System.out.println(trainingClass.toString());
        }
        
        //set date field
        try {
            date.setDate(trainingClass.getStartTime());
        } catch (PropertyVetoException ex) {
            System.err.println("Set data error in class details.");
        }

        
        //Load time fields
        DateFormat df1 = new SimpleDateFormat("hh");
        fromTimeHour.setSelectedItem(df1.format(trainingClass.getStartTime()));
        toTimeHour.setSelectedItem(df1.format(trainingClass.getEndTime()));

        DateFormat df2 = new SimpleDateFormat("mm");
        fromTimeMin.setSelectedItem(df2.format(trainingClass.getStartTime()));
        toTimeMin.setSelectedItem(df2.format(trainingClass.getEndTime()));

        DateFormat df3 = new SimpleDateFormat("aa");
        fromTimeAmPm.setSelectedItem(df3.format(trainingClass.getStartTime()));
        toTimeAmPm.setSelectedItem(df3.format(trainingClass.getEndTime()));

        //If canceled then the name will say so
        String canceled = "";
        if (trainingClass.getCanceled()) {
            canceled = "**Canceled** - ";
        }
        //Set class name
        name.setText(canceled + trainingClass.getName());

        //Get gym that the class is at
        Gym gym = (Gym) MongoHelper.fetch(new Gym(trainingClass.getGymID()), "gyms");
        

        //Set selected gym to the one it is hosted at
        int i = 0;
        while (i < location.getItemCount()) {
            if (location.getItemAt(i).toString().equals(gym.getName())) {
                location.setSelectedIndex(i);
                setOrgGymIndex((Integer) i);
            }
            i++;
        }


        //Set selected trainer to the class trainer
        if (!trainingClass.getTrainer().getFirstName().isEmpty()
                && !trainingClass.getTrainer().getLastName().isEmpty()) {
            trainer.setSelectedItem(trainingClass.getTrainer().getFirstName() + " "
                    + trainingClass.getTrainer().getLastName());
            setOrgTrainerIndex((Integer) trainer.getSelectedIndex());
        } 
        else 
        //Trainer is blank
        //Should not get to this code
        {
            trainer.setSelectedItem("Trainer TBD");
        }
        
        //Set other fields
        level.setSelectedItem(trainingClass.getLevel());
        maxCapacity.setText(trainingClass.getMaxCapacity().toString());
        details.setText(trainingClass.getWorkoutDetails());
        price.setText(trainingClass.getPrice().toString());
        comments.setText(trainingClass.getComments());

        //Set price
        NumberFormat formatter = NumberFormat.getCurrencyInstance();
        price.setText(formatter.format(trainingClass.getPrice()));
        
        if (UserSession.getDebug()) {
            System.out.println("Integer.parseInt(maxCapacity.toString() = " + trainingClass.getMaxCapacity());
            System.out.println("trainingClass.getUserIds().size() = " + trainingClass.getUserIds().size());
        }

        //Set open slots
        if (!trainingClass.getCanceled()) {
            openSlots.setText("" + (trainingClass.getMaxCapacity() - trainingClass.getUserIds().size()));
        }
        else {
            openSlots.setText("0");
        }

        //Reset view to beginning
        details.setCaretPosition(0);
        comments.setCaretPosition(0);
    }