*/
private void setDates(int sessionID) {
long startTime, finishTime;
GregorianCalendar startCalendar, finishCalendar;
SimpleDateFormat dateFormat, timeFormat;
DataSetsDAO dataSetsDAO;
dateFormat = new SimpleDateFormat("dd/MM/yyyy");
timeFormat = new SimpleDateFormat("H:mm:ss");
startCalendar = new GregorianCalendar();
finishCalendar = new GregorianCalendar();
try {
dataSetsDAO = DAOFactory.getDataSetsDAO();
startCalendar.setTimeInMillis(dataSetsDAO.retrieveSessionStartTime(sessionID));
finishCalendar.setTimeInMillis(dataSetsDAO.retrieveSessionFinishTime(sessionID));
fromDateField.setText(dateFormat.format(startCalendar.getTime()));
fromTimeField.setText(timeFormat.format(startCalendar.getTime()));
toDateField.setText(dateFormat.format(finishCalendar.getTime()));
if ( ! toTimeField.isFocusOwner() )
toTimeField.setText(timeFormat.format(finishCalendar.getTime()));
dataSetsDAO.closeConnection();
} catch (DBException e) {
ErrorHandler.modalError(this, "Cannot retrieve data from database", "Update of session title in database unsuccessful", e);
}
}