Added Faculty management
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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.");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user