Skip to content

Commit

Permalink
Select second index before first
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeach committed Jun 17, 2018
1 parent 35cafc2 commit 864207c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/ui/UI.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,13 @@ public void actionPerformed(ActionEvent e) {
// Set contents of date selection combo box
mainPanels.dateSelectionPanel.comboBox.setModel(
new DefaultComboBoxModel<Date>(CSVReader.getDates()));
// Set date to first listed date by default
Settings.date = CSVReader.getDates()[0];
/*
* Set date to first listed by default. For some reason, you have to select another index
* first and then index 0. Perhaps selecting index 0 first isn't registered because it's
* considered redundant after setting the model of the combo box?
*/
mainPanels.dateSelectionPanel.comboBox.setSelectedIndex(1);
mainPanels.dateSelectionPanel.comboBox.setSelectedIndex(0);
// Enable next button
setNavigationButtonsEnabledStates(true, true);
}
Expand Down

0 comments on commit 864207c

Please sign in to comment.