From e20681b9fce97bee4f308dac8984b877cf2daeb3 Mon Sep 17 00:00:00 2001 From: potzplitz <127513690+potzplitz@users.noreply.github.com> Date: Sat, 2 Mar 2024 17:19:12 +0100 Subject: [PATCH] update --- src/gui/MainGUI.java | 30 +++++++++++++++++++++--------- ver/version.txt | 4 ++-- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/gui/MainGUI.java b/src/gui/MainGUI.java index ff57451..b457a5f 100644 --- a/src/gui/MainGUI.java +++ b/src/gui/MainGUI.java @@ -55,7 +55,7 @@ public class MainGUI { public JScrollPane records = new JScrollPane(recordspanel); public JCheckBox filtercompleted = new JCheckBox("Nach geschaft filtern"); public Button copyid = new Button("Level ID kopieren"); - + GridLayout gridLayout = new GridLayout(3, 1); private String[] showing = {"Alle anzeigen", "Top 3", "Top 50", "Top 150", "Top 200"}; @SuppressWarnings({ "unchecked", "rawtypes" }) public JComboBox show = new JComboBox(showing); @@ -70,6 +70,8 @@ public class MainGUI { data.IndexLevelID(); data.IndexVerifiers(); data.IndexCreators(); + + gridLayout.setRows(data.getLocalLevels().size()); main.setSize(900, 700); main.setLayout(null); @@ -91,7 +93,8 @@ public class MainGUI { levelpanel.setBackground(Color.LIGHT_GRAY); levelpanel.setBorder(BorderFactory.createLineBorder(Color.BLACK)); - levelpanel.setLayout(new GridLayout(data.getLocalLevels().size(), 1)); + levelpanel.setLayout(gridLayout); + recordspanel.setBackground(Color.LIGHT_GRAY); recordspanel.setBorder(BorderFactory.createLineBorder(Color.BLACK)); @@ -129,10 +132,6 @@ public class MainGUI { currentLevel.setText(data.getLocalLevels().get(i)); - - - - JPanel contents = new JPanel(); contents.setName(data.getLocalLevels().get(i)); contents.setPreferredSize(new Dimension(600, 50)); @@ -242,6 +241,7 @@ public class MainGUI { if(show.getSelectedIndex() == 1) { if(!(Integer.parseInt(rank.getName()) >= 0 && Integer.parseInt(rank.getName()) <= 2)) { levelpanel.remove(contents); + levelpanel.repaint(); levelpanel.revalidate(); } @@ -267,8 +267,12 @@ public class MainGUI { levelpanel.repaint(); levelpanel.revalidate(); } - } - + } + gridLayout.setRows(levelpanel.getComponentCount()); + gridLayout.setColumns(1); + levelpanel.revalidate(); + scroll.repaint(); + scroll.revalidate(); } }); @@ -290,7 +294,12 @@ public class MainGUI { levelpanel.add(contents); levelpanel.repaint(); levelpanel.revalidate(); - } + } + gridLayout.setRows(levelpanel.getComponentCount()); + gridLayout.setColumns(1); + levelpanel.revalidate(); + scroll.repaint(); + scroll.revalidate(); } @Override public void keyPressed(KeyEvent e) { @@ -307,6 +316,9 @@ public class MainGUI { if (e.getStateChange() == ItemEvent.SELECTED) { if (!contents.getBackground().equals(Color.decode("#cbffbf"))) { levelpanel.remove(contents); + gridLayout.setRows(data.getCompleted().size()); + scroll.repaint(); + scroll.revalidate(); } } else if (e.getStateChange() == ItemEvent.DESELECTED) { levelpanel.add(contents, 0); // Füge das Element am Anfang hinzu diff --git a/ver/version.txt b/ver/version.txt index cc5ae78..2cab3de 100644 --- a/ver/version.txt +++ b/ver/version.txt @@ -1,2 +1,2 @@ -1.3 -https://github.com/potzplitz/ExtremeDemonList/releases/download/sdfdf/List.jar \ No newline at end of file +1.4 +https://github.com/potzplitz/ExtremeDemonList/releases/download/List1.4/List.jar \ No newline at end of file