fixed issue so that UserGroup stays as a singleton instance so that all users are stored in it properly

This commit is contained in:
bobbert committed 2025-04-02 13:21:52 +01:00
1 parent eb233f43f9
commit 1ea89164f4
2 files changed
+18 -7

No files matched your search

+9 -5
View File
@@ -5,10 +5,13 @@ import cvbuilder.model.UserGroup;
import javax.swing.*;
public class MainViewer {
private UserGroup userGroup;
public MainViewer() {
userGroup = UserGroup.getInstance();
JFrame viewer = new JFrame("CV Builder");
viewer.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
viewer.setSize(800, 500);
@@ -65,13 +68,14 @@ public class MainViewer {
ButtonGroup group = new ButtonGroup();
String panelName = panel.getName();
for (User user : UserGroup.getUsers()) {
for (User user : userGroup.getUsers()) {
JRadioButton radioButton = new JRadioButton(user.getUserAttribute(panelName));
group.add(radioButton);
panel.add(radioButton);
}
}
}
public static void main(String[] args) {
SwingUtilities.invokeLater(MainViewer::new);
}
}