Monday, April 23, 2012

Address memory of variable being output in java

This code below is meant to populate the combo box with available times according to the selected date.



However for some reason the combo box is storing the memory address of the data example:



Restaurant.Time@1a28362
Restaurant.Time@5fcf29
...


I know its getting the right times. But how do I actual print out the actual item?



TimeList times = dbConnector.selectTimes(lblDay.getText());//lblDay stores the date from the jCalendar button
cmbNewResTimes.removeAllItems();
for (int pos1 = 0; pos1 < times.size(); pos1++) {
cmbNewResTimes.addItem(times.getTimeAt(pos1).toString());
}




No comments:

Post a Comment