From 23cd5d4b3da47af23229222116c811bc33c1a0bb Mon Sep 17 00:00:00 2001 From: flifloo Date: Tue, 12 Jan 2021 15:31:30 +0100 Subject: [PATCH] Fix Tergel mess v2 --- src/main/java/GUI/GUI.java | 2 +- src/main/java/GUI/ProjectionHandler.java | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/GUI/GUI.java b/src/main/java/GUI/GUI.java index 4d4d07a..27fd50e 100644 --- a/src/main/java/GUI/GUI.java +++ b/src/main/java/GUI/GUI.java @@ -52,7 +52,7 @@ public class GUI extends JFrame implements ActionListener { setIconImage(img.getImage()); this.renderMenu(); - new Agenda(agendaPanel, this.currentPage, this.currentCompetition); + agenda = new Agenda(agendaPanel, this.currentPage, this.currentCompetition); previousButton.addActionListener(this); nextButton.addActionListener(this); HCButton.addActionListener(this); diff --git a/src/main/java/GUI/ProjectionHandler.java b/src/main/java/GUI/ProjectionHandler.java index afe3b15..7e0e48d 100644 --- a/src/main/java/GUI/ProjectionHandler.java +++ b/src/main/java/GUI/ProjectionHandler.java @@ -48,10 +48,15 @@ public class ProjectionHandler extends JDialog { this.agenda = agenda; try { competitionComboBox.getModel().setSelectedItem(agenda.getCompetition()); - } catch (NotFoundInTable ignored) { + } catch (NotFoundInTable ignored) {} + if (agenda.getDate() != null || agenda.getSlot() != null) { + updateMovies(); + updateDates(); + dayComboBox.getModel().setSelectedItem(agenda.getDate()); + updateSlots(); + slotComboBox.getModel().setSelectedItem(agenda.getSlot()); + updateRooms(); } - dayComboBox.getModel().setSelectedItem(agenda.getDate()); - slotComboBox.getModel().setSelectedItem(agenda.getSlot()); createUIComponents(); }