Skip to content

Commit

Permalink
Force auto refresh on current time
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibstars committed Nov 20, 2023
1 parent 79406a3 commit b2f99ad
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ public LiveBoardPanel(LiveBoardController liveBoardController, LiveBoard liveBoa
timePicker.setTime(LocalTime.now());
timePicker.addTimeChangeListener(event -> liveBoardController.refreshLiveBoard(this, liveBoard.stationInfo().id(), event.getNewTime()));
timePicker.setToolTipText(liveBoardController.getMessage("live.board.time.picker.tooltip"));
pnlRefresh.addRefreshListener(actionEvent -> liveBoardController.refreshLiveBoard(this, liveBoard.stationInfo().id(), timePicker.getTime()));
pnlRefresh.addRefreshListener(actionEvent -> {
LocalTime rightNow = LocalTime.now();
timePicker.setTime(rightNow);
liveBoardController.refreshLiveBoard(this, liveBoard.stationInfo().id(), rightNow);
});

JPanel pnlContent = new JPanel(new BorderLayout());
Departures departures = liveBoard.departures();
Expand Down

0 comments on commit b2f99ad

Please sign in to comment.