Added Faculty management

This commit is contained in:
2023-09-25 21:29:16 +03:00
parent b703d8f658
commit 6e36fe56fa
8 changed files with 101 additions and 14 deletions

View File

@@ -25,7 +25,6 @@ public class StudentManagementGUI {
int centerY = (int) ((screenSize.getHeight() - frame.getHeight()) / 2);
frame.setLocation(centerX, centerY);
JPanel mainPanel = new JPanel();
mainPanel.setLayout(new BorderLayout());
@@ -37,6 +36,21 @@ public class StudentManagementGUI {
mainPanel.add(scrollPane, BorderLayout.CENTER);
String[] options = {"Option 1", "Option 2", "Option 3"};
JComboBox<String> dropdown = new JComboBox<>(options);
JButton button = new JButton("Show Selected Option");
button.addActionListener(e -> {
String selectedOption = (String) dropdown.getSelectedItem();
System.out.println(selectedOption);
});
button.setSize(new Dimension(100, 100));
mainPanel.add(dropdown);
mainPanel.add(button);
JPanel buttonPanel = new JPanel(new GridLayout(0, 1));
JButton showStudentsBtn = new JButton("Show Students");

View File

@@ -43,8 +43,11 @@ public class AddStudentForm extends JFrame {
String faculty = facultyField.getText();
FullStudentData data = new FullStudentData(name, surname, group, faculty);
if (!name.isEmpty() && !surname.isEmpty() && !group.isEmpty() && !faculty.isEmpty()) {
sv.getFm().getGm().getSm().addStudent(data);
sv.getFm().getGm().getSm().addStudent(data, sv);
outputTextArea.setText("===== Students =====\n" + sv.getStudentsText());
System.out.println(data);
System.out.println("LOL");
System.out.println(sv.getStudentsText());
this.dispose();
} else JOptionPane.showMessageDialog(this, "Please fill in all fields.");
});