Improved UI, major functions still WIP
This commit is contained in:
@@ -2,11 +2,8 @@ package org.lumijiez;
|
||||
|
||||
import org.lumijiez.gui.StudentManagementGUI;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SwingUtilities.invokeLater(StudentManagementGUI::new);
|
||||
java.awt.EventQueue.invokeLater(() -> new StudentManagementGUI().setVisible(true));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.lumijiez.enums;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public enum StudyField implements Serializable {
|
||||
DEFAULT_UNASSIGNED("Unassigned", "None"),
|
||||
@@ -19,6 +21,20 @@ public enum StudyField implements Serializable {
|
||||
this.abbreviation = abbreviation;
|
||||
}
|
||||
|
||||
public static String getAbbrevFromString(String str) {
|
||||
for (StudyField st : values()) {
|
||||
if (st.name.equals(str)) return st.abbreviation;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public static StudyField getEnum(String str) {
|
||||
for (StudyField st : values()) {
|
||||
if (st.name.equals(str)) return st;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@@ -26,4 +42,8 @@ public enum StudyField implements Serializable {
|
||||
public String getAbbreviation() {
|
||||
return abbreviation;
|
||||
}
|
||||
|
||||
public static List<StudyField> getAllEnums() {
|
||||
return Arrays.asList(values());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,100 +1,294 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||
*/
|
||||
package org.lumijiez.gui;
|
||||
|
||||
import org.lumijiez.base.Faculty;
|
||||
import org.lumijiez.data.DataDeserializer;
|
||||
import org.lumijiez.data.DataSerializer;
|
||||
import org.lumijiez.gui.forms.*;
|
||||
import org.lumijiez.gui.forms.faculty.AddFacultyForm;
|
||||
import org.lumijiez.gui.forms.faculty.EditFacultyForm;
|
||||
import org.lumijiez.gui.forms.faculty.RemoveFacultyForm;
|
||||
import org.lumijiez.gui.forms.faculty.ShowFacultyForm;
|
||||
import org.lumijiez.gui.forms.group.AddGroupForm;
|
||||
import org.lumijiez.gui.forms.group.EditGroupForm;
|
||||
import org.lumijiez.gui.forms.group.ShowGroupForm;
|
||||
import org.lumijiez.gui.forms.student.*;
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class StudentManagementGUI {
|
||||
private final Supervisor studentManager;
|
||||
private final JFrame frame;
|
||||
private final JTextArea outputTextArea;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
|
||||
public class StudentManagementGUI extends JFrame {
|
||||
private Supervisor sv;
|
||||
JLabel mainTextLabel = new JLabel();
|
||||
public StudentManagementGUI() {
|
||||
studentManager = DataDeserializer.deserialize();
|
||||
this.sv = sv;
|
||||
initComponents();
|
||||
this.sv = DataDeserializer.deserialize();
|
||||
}
|
||||
private void initComponents() {
|
||||
|
||||
frame = new JFrame("Student Management System");
|
||||
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||
frame.setSize(800, 600);
|
||||
|
||||
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
int centerX = (int) ((screenSize.getWidth() - frame.getWidth()) / 2);
|
||||
int centerY = (int) ((screenSize.getHeight() - frame.getHeight()) / 2);
|
||||
frame.setLocation(centerX, centerY);
|
||||
JMenuBar menuBar = new JMenuBar();
|
||||
JMenu fileMenu = new JMenu();
|
||||
JMenuItem loadBatchOption = new JMenuItem();
|
||||
JMenuItem saveAsOption = new JMenuItem();
|
||||
JMenuItem saveAndExitOption = new JMenuItem();
|
||||
JMenuItem settingsOption = new JMenuItem();
|
||||
JMenu studentMenu = new JMenu();
|
||||
JMenuItem showAllStudentsOption = new JMenuItem();
|
||||
JMenuItem showParticularStudentOption = new JMenuItem();
|
||||
JMenuItem showStudentGrade = new JMenuItem();
|
||||
JPopupMenu.Separator studentSeparator = new JPopupMenu.Separator();
|
||||
JMenuItem gradeStudentOption = new JMenuItem();
|
||||
JMenuItem addStudentOption = new JMenuItem();
|
||||
JMenuItem editStudentOption = new JMenuItem();
|
||||
JMenuItem deleteStudentOption = new JMenuItem();
|
||||
JMenu groupMenu = new JMenu();
|
||||
JMenuItem showAllGroupsOption = new JMenuItem();
|
||||
JMenuItem showParticularGroupOption = new JMenuItem();
|
||||
JPopupMenu.Separator groupSeparator = new JPopupMenu.Separator();
|
||||
JMenuItem addGroupOption = new JMenuItem();
|
||||
JMenuItem editGroupOption = new JMenuItem();
|
||||
JMenuItem deleteGroupOption = new JMenuItem();
|
||||
JMenu facultyMenu = new JMenu();
|
||||
JMenuItem showAllFacultiesOption = new JMenuItem();
|
||||
JMenuItem showParticularFacultyOption = new JMenuItem();
|
||||
JPopupMenu.Separator facultySeparator = new JPopupMenu.Separator();
|
||||
JMenuItem addFacultyOption = new JMenuItem();
|
||||
JMenuItem editFacultyOption = new JMenuItem();
|
||||
JMenuItem removeFacultyOption = new JMenuItem();
|
||||
|
||||
JPanel mainPanel = new JPanel();
|
||||
mainPanel.setLayout(new BorderLayout());
|
||||
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||
|
||||
outputTextArea = new JTextArea();
|
||||
outputTextArea.setEditable(false);
|
||||
outputTextArea.setText("===== Students =====\n" + studentManager.getStudentsText());
|
||||
this.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e) {
|
||||
int result = JOptionPane.showConfirmDialog(
|
||||
StudentManagementGUI.this,
|
||||
"Are you sure you want to exit?",
|
||||
"Confirmation",
|
||||
JOptionPane.YES_NO_OPTION
|
||||
);
|
||||
|
||||
JScrollPane scrollPane = new JScrollPane(outputTextArea);
|
||||
|
||||
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);
|
||||
if (result == JOptionPane.YES_OPTION) {
|
||||
DataSerializer.serialize(sv);
|
||||
dispose();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
button.setSize(new Dimension(100, 100));
|
||||
fileMenu.setText("File");
|
||||
|
||||
mainPanel.add(dropdown);
|
||||
mainPanel.add(button);
|
||||
loadBatchOption.setText("Load Batch File");
|
||||
loadBatchOption.addActionListener(this::loadBatchOptionActionPerformed);
|
||||
fileMenu.add(loadBatchOption);
|
||||
|
||||
JPanel buttonPanel = new JPanel(new GridLayout(0, 1));
|
||||
saveAsOption.setText("Save As File");
|
||||
saveAsOption.addActionListener(this::saveAsOptionActionPerformed);
|
||||
fileMenu.add(saveAsOption);
|
||||
|
||||
JButton showStudentsBtn = new JButton("Show Students");
|
||||
JButton showGroupsBtn = new JButton("Show Groups");
|
||||
JButton changeStudentGroup = new JButton("Change group");
|
||||
JButton addStudentBtn = new JButton("Add Student");
|
||||
JButton addStudentGrade = new JButton("Add Grade");
|
||||
JButton deleteStudentBtn = new JButton("Delete Student");
|
||||
JButton showStudentGradesBtn = new JButton("Show Student Grades");
|
||||
JButton saveAndExitBtn = new JButton("Save and Exit");
|
||||
saveAndExitOption.setText("Save And Exit");
|
||||
saveAndExitOption.addActionListener(this::saveAndExitOptionActionPerformed);
|
||||
fileMenu.add(saveAndExitOption);
|
||||
|
||||
settingsOption.setText("Settings");
|
||||
fileMenu.add(settingsOption);
|
||||
|
||||
showStudentsBtn.addActionListener(e -> outputTextArea.setText("===== Students =====\n" + studentManager.getStudentsText()));
|
||||
menuBar.add(fileMenu);
|
||||
|
||||
showGroupsBtn.addActionListener(e -> outputTextArea.setText("===== Groups =====\n" + studentManager.getGroupsText()));
|
||||
studentMenu.setText("Student Options");
|
||||
|
||||
addStudentBtn.addActionListener(e -> new AddStudentForm(centerX, centerY, studentManager, outputTextArea));
|
||||
showAllStudentsOption.setText("Show All Students");
|
||||
studentMenu.add(showAllStudentsOption);
|
||||
|
||||
changeStudentGroup.addActionListener(e -> new ChangeGroupForm(centerX, centerY, studentManager, outputTextArea));
|
||||
showParticularStudentOption.setText("Show Student");
|
||||
showParticularStudentOption.addActionListener(this::showParticularStudentOptionActionPerformed);
|
||||
studentMenu.add(showParticularStudentOption);
|
||||
|
||||
showStudentGradesBtn.addActionListener(e -> new ShowGradesForm(centerX, centerY, studentManager, outputTextArea));
|
||||
showStudentGrade.setText("Show Student Grades");
|
||||
showStudentGrade.addActionListener(this::showStudentGradeActionPerformed);
|
||||
studentMenu.add(showStudentGrade);
|
||||
studentMenu.add(studentSeparator);
|
||||
|
||||
deleteStudentBtn.addActionListener(e -> new DeleteStudentForm(centerX, centerY, studentManager, outputTextArea));
|
||||
gradeStudentOption.setText("Grade Student");
|
||||
gradeStudentOption.addActionListener(this::gradeStudentOptionActionPerformed);
|
||||
studentMenu.add(gradeStudentOption);
|
||||
|
||||
addStudentGrade.addActionListener(e -> new AddGradeForm(centerX, centerY, studentManager, outputTextArea));
|
||||
addStudentOption.setText("Add Student");
|
||||
addStudentOption.addActionListener(this::addStudentOptionActionPerformed);
|
||||
studentMenu.add(addStudentOption);
|
||||
|
||||
editStudentOption.setText("Edit Student");
|
||||
editStudentOption.addActionListener(this::editStudentOptionActionPerformed);
|
||||
studentMenu.add(editStudentOption);
|
||||
|
||||
saveAndExitBtn.addActionListener(e -> {
|
||||
DataSerializer.serialize(studentManager);
|
||||
frame.dispose();
|
||||
System.exit(0);
|
||||
});
|
||||
deleteStudentOption.setText("Delete Student");
|
||||
deleteStudentOption.addActionListener(this::deleteStudentOptionActionPerformed);
|
||||
studentMenu.add(deleteStudentOption);
|
||||
|
||||
buttonPanel.add(showStudentsBtn);
|
||||
buttonPanel.add(showGroupsBtn);
|
||||
buttonPanel.add(showStudentGradesBtn);
|
||||
buttonPanel.add(addStudentBtn);
|
||||
buttonPanel.add(addStudentGrade);
|
||||
buttonPanel.add(deleteStudentBtn);
|
||||
buttonPanel.add(saveAndExitBtn);
|
||||
menuBar.add(studentMenu);
|
||||
|
||||
mainPanel.add(buttonPanel, BorderLayout.WEST);
|
||||
groupMenu.setText("Group Options");
|
||||
|
||||
frame.getContentPane().add(mainPanel);
|
||||
frame.setVisible(true);
|
||||
showAllGroupsOption.setText("Show All Groups");
|
||||
groupMenu.add(showAllGroupsOption);
|
||||
|
||||
showParticularGroupOption.setText("Show Group");
|
||||
showParticularGroupOption.addActionListener(this::showParticularGroupOptionActionPerformed);
|
||||
groupMenu.add(showParticularGroupOption);
|
||||
groupMenu.add(groupSeparator);
|
||||
|
||||
addGroupOption.setText("Add Group");
|
||||
addGroupOption.addActionListener(this::addGroupOptionActionPerformed);
|
||||
groupMenu.add(addGroupOption);
|
||||
|
||||
editGroupOption.setText("Edit Group");
|
||||
editGroupOption.addActionListener(this::editGroupOptionActionPerformed);
|
||||
groupMenu.add(editGroupOption);
|
||||
|
||||
deleteGroupOption.setText("Delete Group");
|
||||
groupMenu.add(deleteGroupOption);
|
||||
|
||||
menuBar.add(groupMenu);
|
||||
|
||||
facultyMenu.setText("Faculty Options");
|
||||
|
||||
showAllFacultiesOption.setText("Show Faculties");
|
||||
showAllFacultiesOption.addActionListener(this::showAllFacultiesOptionActionPerformed);
|
||||
facultyMenu.add(showAllFacultiesOption);
|
||||
|
||||
showParticularFacultyOption.setText("Show A Faculty");
|
||||
showParticularFacultyOption.addActionListener(this::showParticularFacultyOptionActionPerformed);
|
||||
facultyMenu.add(showParticularFacultyOption);
|
||||
facultyMenu.add(facultySeparator);
|
||||
|
||||
addFacultyOption.setText("Add Faculty");
|
||||
addFacultyOption.addActionListener(this::addFacultyOptionActionPerformed);
|
||||
facultyMenu.add(addFacultyOption);
|
||||
|
||||
editFacultyOption.setText("Edit Faculty");
|
||||
editFacultyOption.addActionListener(this::editFacultyOptionActionPerformed);
|
||||
facultyMenu.add(editFacultyOption);
|
||||
|
||||
removeFacultyOption.setText("Remove Faculty");
|
||||
removeFacultyOption.addActionListener(this::removeFacultyOptionActionPerformed);
|
||||
facultyMenu.add(removeFacultyOption);
|
||||
|
||||
menuBar.add(facultyMenu);
|
||||
|
||||
setJMenuBar(menuBar);
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(mainTextLabel, GroupLayout.DEFAULT_SIZE, 1280, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(mainTextLabel, GroupLayout.DEFAULT_SIZE, 697, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
private void loadBatchOptionActionPerformed(ActionEvent evt) {
|
||||
|
||||
}
|
||||
|
||||
private void saveAndExitOptionActionPerformed(ActionEvent evt) {
|
||||
int result = JOptionPane.showConfirmDialog(
|
||||
StudentManagementGUI.this,
|
||||
"Are you sure you want to exit?",
|
||||
"Confirmation",
|
||||
JOptionPane.YES_NO_OPTION
|
||||
);
|
||||
|
||||
if (result == JOptionPane.YES_OPTION) {
|
||||
DataSerializer.serialize(sv);
|
||||
dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private void showAllFacultiesOptionActionPerformed(ActionEvent evt) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (Faculty fc : sv.getFm().getFaculties()) {
|
||||
builder.append(fc.getName()).append(" ").append(fc.getAbbreviation()).append(" ").append(fc.getField().getName());
|
||||
}
|
||||
mainTextLabel.setText(builder.toString());
|
||||
}
|
||||
|
||||
private void saveAsOptionActionPerformed(ActionEvent evt) {
|
||||
|
||||
}
|
||||
|
||||
private void showParticularGroupOptionActionPerformed(ActionEvent evt) {
|
||||
ShowGroupForm form = new ShowGroupForm(sv, mainTextLabel);
|
||||
form.setVisible(true);
|
||||
}
|
||||
|
||||
private void addFacultyOptionActionPerformed(ActionEvent evt) {
|
||||
AddFacultyForm form = new AddFacultyForm(sv, mainTextLabel);
|
||||
form.setVisible(true);
|
||||
}
|
||||
|
||||
private void addStudentOptionActionPerformed(ActionEvent evt) {
|
||||
AddStudentForm form = new AddStudentForm(sv, mainTextLabel);
|
||||
form.setVisible(true);
|
||||
}
|
||||
|
||||
private void gradeStudentOptionActionPerformed(ActionEvent evt) {
|
||||
GradeStudentForm form = new GradeStudentForm(sv, mainTextLabel);
|
||||
form.setVisible(true);
|
||||
}
|
||||
|
||||
private void editStudentOptionActionPerformed(ActionEvent evt) {
|
||||
EditStudentForm form = new EditStudentForm(sv, mainTextLabel);
|
||||
form.setVisible(true);
|
||||
}
|
||||
|
||||
private void deleteStudentOptionActionPerformed(ActionEvent evt) {
|
||||
DeleteStudentForm form = new DeleteStudentForm(sv, mainTextLabel);
|
||||
form.setVisible(true);
|
||||
}
|
||||
|
||||
private void showStudentGradeActionPerformed(ActionEvent evt) {
|
||||
ShowStudentGradesForm form = new ShowStudentGradesForm(sv, mainTextLabel);
|
||||
form.setVisible(true);
|
||||
}
|
||||
|
||||
private void showParticularStudentOptionActionPerformed(ActionEvent evt) {
|
||||
ShowStudentForm form = new ShowStudentForm(sv, mainTextLabel);
|
||||
form.setVisible(true);
|
||||
}
|
||||
|
||||
private void addGroupOptionActionPerformed(ActionEvent evt) {
|
||||
AddGroupForm form = new AddGroupForm(sv, mainTextLabel);
|
||||
form.setVisible(true);
|
||||
}
|
||||
|
||||
private void editGroupOptionActionPerformed(ActionEvent evt) {
|
||||
EditGroupForm form = new EditGroupForm(sv, mainTextLabel);
|
||||
form.setVisible(true);
|
||||
}
|
||||
|
||||
private void showParticularFacultyOptionActionPerformed(ActionEvent evt) {
|
||||
ShowFacultyForm form = new ShowFacultyForm(sv, mainTextLabel);
|
||||
form.setVisible(true);
|
||||
}
|
||||
|
||||
private void editFacultyOptionActionPerformed(ActionEvent evt) {
|
||||
EditFacultyForm form = new EditFacultyForm(sv, mainTextLabel);
|
||||
form.setVisible(true);
|
||||
}
|
||||
|
||||
private void removeFacultyOptionActionPerformed(ActionEvent evt) {
|
||||
RemoveFacultyForm form = new RemoveFacultyForm(sv, mainTextLabel);
|
||||
form.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
package org.lumijiez.gui.forms;
|
||||
|
||||
import org.lumijiez.base.Grade;
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
import org.lumijiez.util.FullStudentData;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class AddGradeForm extends JFrame {
|
||||
public AddGradeForm(int centerX, int centerY, Supervisor sv, JTextArea outputTextArea) {
|
||||
this.setTitle("Add Grade");
|
||||
this.setSize(400, 300);
|
||||
this.setLocation(centerX, centerY);
|
||||
|
||||
JPanel formPanel = new JPanel(new GridLayout(4, 2));
|
||||
|
||||
JLabel nameLabel = new JLabel("Name:");
|
||||
JTextField nameField = new JTextField();
|
||||
JLabel surnameLabel = new JLabel("Surname:");
|
||||
JTextField surnameField = new JTextField();
|
||||
JLabel groupLabel = new JLabel("Group:");
|
||||
JTextField groupField = new JTextField();
|
||||
JLabel facultyLabel = new JLabel("Faculty:");
|
||||
JTextField facultyField = new JTextField();
|
||||
JLabel subjectLabel = new JLabel("Subject:");
|
||||
JTextField subjectField = new JTextField();
|
||||
JLabel gradeLabel = new JLabel("Grade:");
|
||||
JTextField gradeField = new JTextField();
|
||||
|
||||
JButton submitButton = new JButton("Submit");
|
||||
|
||||
|
||||
formPanel.add(nameLabel);
|
||||
formPanel.add(nameField);
|
||||
formPanel.add(surnameLabel);
|
||||
formPanel.add(surnameField);
|
||||
formPanel.add(groupLabel);
|
||||
formPanel.add(groupField);
|
||||
formPanel.add(facultyLabel);
|
||||
formPanel.add(facultyField);
|
||||
formPanel.add(subjectLabel);
|
||||
formPanel.add(subjectField);
|
||||
formPanel.add(gradeLabel);
|
||||
formPanel.add(gradeField);
|
||||
formPanel.add(submitButton);
|
||||
|
||||
this.add(formPanel);
|
||||
|
||||
submitButton.addActionListener(e -> {
|
||||
String name = nameField.getText();
|
||||
String surname = surnameField.getText();
|
||||
String group = groupField.getText();
|
||||
String subject = subjectField.getText();
|
||||
String grade = gradeField.getText();
|
||||
String faculty = facultyField.getText();
|
||||
FullStudentData data = new FullStudentData(name, surname, group, faculty);
|
||||
if (!name.isEmpty() && !surname.isEmpty() && !group.isEmpty() && !subject.isEmpty() && !grade.isEmpty() && !faculty.isEmpty()) {
|
||||
sv.getFm().getGm().getSm().getStudent(data).addGrade(new Grade(subject, Integer.parseInt(grade)));
|
||||
outputTextArea.setText("===== Students =====\n" + sv.getStudentsText());
|
||||
this.dispose();
|
||||
} else JOptionPane.showMessageDialog(this, "Please fill in all fields.");
|
||||
});
|
||||
this.setVisible(true);
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package org.lumijiez.gui.forms;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
import org.lumijiez.util.FullStudentData;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class AddStudentForm extends JFrame {
|
||||
public AddStudentForm(int centerX, int centerY, Supervisor sv, JTextArea outputTextArea) {
|
||||
this.setTitle("Add Student");
|
||||
this.setSize(400, 300);
|
||||
this.setLocation(centerX, centerY);
|
||||
|
||||
JPanel formPanel = new JPanel(new GridLayout(4, 2));
|
||||
|
||||
JLabel nameLabel = new JLabel("Name:");
|
||||
JTextField nameField = new JTextField();
|
||||
JLabel surnameLabel = new JLabel("Surname:");
|
||||
JTextField surnameField = new JTextField();
|
||||
JLabel groupLabel = new JLabel("Group:");
|
||||
JTextField groupField = new JTextField();
|
||||
JLabel facultyLabel = new JLabel("Faculty:");
|
||||
JTextField facultyField = new JTextField();
|
||||
JButton submitButton = new JButton("Submit");
|
||||
|
||||
formPanel.add(nameLabel);
|
||||
formPanel.add(nameField);
|
||||
formPanel.add(surnameLabel);
|
||||
formPanel.add(surnameField);
|
||||
formPanel.add(groupLabel);
|
||||
formPanel.add(groupField);
|
||||
formPanel.add(facultyLabel);
|
||||
formPanel.add(facultyField);
|
||||
formPanel.add(submitButton);
|
||||
|
||||
this.add(formPanel);
|
||||
|
||||
submitButton.addActionListener(e -> {
|
||||
String name = nameField.getText();
|
||||
String surname = surnameField.getText();
|
||||
String group = groupField.getText();
|
||||
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);
|
||||
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.");
|
||||
});
|
||||
this.setVisible(true);
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package org.lumijiez.gui.forms;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
import org.lumijiez.util.FullStudentData;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class ChangeGroupForm extends JFrame {
|
||||
public ChangeGroupForm(int centerX, int centerY, Supervisor sv, JTextArea outputTextArea) {
|
||||
this.setTitle("Change Group");
|
||||
this.setSize(400, 300);
|
||||
this.setLocation(centerX, centerY);
|
||||
|
||||
JPanel formPanel = new JPanel(new GridLayout(4, 2));
|
||||
|
||||
JLabel nameLabel = new JLabel("Name:");
|
||||
JTextField nameField = new JTextField();
|
||||
JLabel surnameLabel = new JLabel("Surname:");
|
||||
JTextField surnameField = new JTextField();
|
||||
JLabel groupLabel = new JLabel("Group:");
|
||||
JTextField groupField = new JTextField();
|
||||
JLabel facultyLabel = new JLabel("Faculty:");
|
||||
JTextField facultyField = new JTextField();
|
||||
JLabel newgroupLabel = new JLabel("New Group:");
|
||||
JTextField newgroupField = new JTextField();
|
||||
JButton submitButton = new JButton("Submit");
|
||||
|
||||
formPanel.add(nameLabel);
|
||||
formPanel.add(nameField);
|
||||
formPanel.add(surnameLabel);
|
||||
formPanel.add(surnameField);
|
||||
formPanel.add(groupLabel);
|
||||
formPanel.add(groupField);
|
||||
formPanel.add(facultyLabel);
|
||||
formPanel.add(facultyField);
|
||||
formPanel.add(newgroupLabel);
|
||||
formPanel.add(newgroupField);
|
||||
formPanel.add(submitButton);
|
||||
|
||||
this.add(formPanel);
|
||||
|
||||
submitButton.addActionListener(e -> {
|
||||
String name = nameField.getText();
|
||||
String surname = surnameField.getText();
|
||||
String group = groupField.getText();
|
||||
String newgroup = newgroupField.getText();
|
||||
String faculty = facultyField.getText();
|
||||
FullStudentData data = new FullStudentData(name, surname, group, faculty);
|
||||
if (!name.isEmpty() && !surname.isEmpty() && !group.isEmpty() && !newgroup.isEmpty()) {
|
||||
//studentManager.changeGroup(new NameSurnameGroup(name, surname, group), newgroup);
|
||||
outputTextArea.setText("===== Groups =====\n" + sv.getGroupsText());
|
||||
this.dispose();
|
||||
} else JOptionPane.showMessageDialog(this, "Please fill in all fields.");
|
||||
});
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package org.lumijiez.gui.forms;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
import org.lumijiez.util.FullStudentData;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class DeleteStudentForm extends JFrame {
|
||||
public DeleteStudentForm(int centerX, int centerY, Supervisor sv, JTextArea outputTextArea) {
|
||||
this.setTitle("Delete Student");
|
||||
this.setSize(400, 300);
|
||||
this.setLocation(centerX, centerY);
|
||||
|
||||
JPanel formPanel = new JPanel(new GridLayout(4, 2));
|
||||
|
||||
JLabel nameLabel = new JLabel("Name:");
|
||||
JTextField nameField = new JTextField();
|
||||
JLabel surnameLabel = new JLabel("Surname:");
|
||||
JTextField surnameField = new JTextField();
|
||||
JLabel groupLabel = new JLabel("Group:");
|
||||
JTextField groupField = new JTextField();
|
||||
JLabel facultyLabel = new JLabel("Faculty:");
|
||||
JTextField facultyField = new JTextField();
|
||||
JButton submitButton = new JButton("Submit");
|
||||
|
||||
formPanel.add(nameLabel);
|
||||
formPanel.add(nameField);
|
||||
formPanel.add(surnameLabel);
|
||||
formPanel.add(surnameField);
|
||||
formPanel.add(groupLabel);
|
||||
formPanel.add(groupField);
|
||||
formPanel.add(facultyLabel);
|
||||
formPanel.add(facultyField);
|
||||
formPanel.add(submitButton);
|
||||
|
||||
this.add(formPanel);
|
||||
|
||||
submitButton.addActionListener(e -> {
|
||||
String name = nameField.getText();
|
||||
String surname = surnameField.getText();
|
||||
String group = groupField.getText();
|
||||
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().deleteStudent(data);
|
||||
outputTextArea.setText("===== Students =====\n" + sv.getStudentsText());
|
||||
this.dispose();
|
||||
} else JOptionPane.showMessageDialog(this, "Please fill in all fields.");
|
||||
});
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package org.lumijiez.gui.forms;
|
||||
|
||||
import org.lumijiez.util.FullStudentData;
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class ShowGradesForm extends JFrame {
|
||||
public ShowGradesForm(int centerX, int centerY, Supervisor sv, JTextArea outputTextArea) {
|
||||
this.setTitle("Show Grades Student");
|
||||
this.setSize(400, 300);
|
||||
this.setLocation(centerX, centerY);
|
||||
|
||||
JPanel formPanel = new JPanel(new GridLayout(4, 2));
|
||||
|
||||
JLabel nameLabel = new JLabel("Name:");
|
||||
JTextField nameField = new JTextField();
|
||||
JLabel surnameLabel = new JLabel("Surname:");
|
||||
JTextField surnameField = new JTextField();
|
||||
JLabel groupLabel = new JLabel("Group:");
|
||||
JTextField groupField = new JTextField();
|
||||
JLabel facultyLabel = new JLabel("Faculty:");
|
||||
JTextField facultyField = new JTextField();
|
||||
JButton submitButton = new JButton("Submit");
|
||||
|
||||
formPanel.add(nameLabel);
|
||||
formPanel.add(nameField);
|
||||
formPanel.add(surnameLabel);
|
||||
formPanel.add(surnameField);
|
||||
formPanel.add(groupLabel);
|
||||
formPanel.add(groupField);
|
||||
formPanel.add(facultyLabel);
|
||||
formPanel.add(facultyField);
|
||||
formPanel.add(submitButton);
|
||||
|
||||
this.add(formPanel);
|
||||
|
||||
submitButton.addActionListener(e -> {
|
||||
String name = nameField.getText();
|
||||
String surname = surnameField.getText();
|
||||
String group = groupField.getText();
|
||||
String faculty = facultyField.getText();
|
||||
FullStudentData data = new FullStudentData(name, surname, group, faculty);
|
||||
if (!name.isEmpty() && !surname.isEmpty() && !group.isEmpty() && !faculty.isEmpty()) {
|
||||
outputTextArea.setText("===== Grades =====\n" + name + " " + surname + "\n" + sv.getGradesText(data));
|
||||
this.dispose();
|
||||
} else JOptionPane.showMessageDialog(this, "Please fill in all fields.");
|
||||
});
|
||||
this.setVisible(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package org.lumijiez.gui.forms.faculty;
|
||||
|
||||
import org.lumijiez.base.Faculty;
|
||||
import org.lumijiez.enums.StudyField;
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import javax.swing.*;
|
||||
import javax.swing.text.Style;
|
||||
|
||||
public class AddFacultyForm extends JFrame {
|
||||
private final Supervisor sv;
|
||||
private final JLabel mainTextLabel;
|
||||
|
||||
private JLabel titleLabel = new JLabel();
|
||||
private JComboBox<String> specialtyCombo = new JComboBox<>();
|
||||
private JTextField nameField = new JTextField();
|
||||
private JButton submitButton = new JButton();
|
||||
private JButton cancelButton = new JButton();
|
||||
private JLabel nameLabel = new JLabel();
|
||||
private JTextField abbreviationField = new JTextField();
|
||||
private JLabel abbreviationLabel = new JLabel();
|
||||
private JLabel specialtyLabel = new JLabel();
|
||||
public AddFacultyForm(Supervisor sv, JLabel mainTextLabel) {
|
||||
this.sv = sv;
|
||||
this.mainTextLabel = mainTextLabel;
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
titleLabel.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
|
||||
titleLabel.setText("Add a new faculty");
|
||||
|
||||
String[] enumList = new String[StudyField.getAllEnums().size()];
|
||||
List<StudyField> sfl = StudyField.getAllEnums();
|
||||
for (int i = 0; i != enumList.length; i++)
|
||||
enumList[i] = sfl.get(i).getName();
|
||||
|
||||
specialtyCombo.setModel(new DefaultComboBoxModel<>(enumList));
|
||||
specialtyCombo.addActionListener(this::specialtyComboActionPerformed);
|
||||
|
||||
nameField.setText("Name...");
|
||||
|
||||
submitButton.setBackground(new java.awt.Color(204, 255, 204));
|
||||
submitButton.setText("Submit");
|
||||
submitButton.addActionListener(this::submitButtonActionPerformed);
|
||||
|
||||
cancelButton.setBackground(new java.awt.Color(255, 204, 204));
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addActionListener(this::cancelButtonActionPerformed);
|
||||
|
||||
nameLabel.setText("Name:");
|
||||
|
||||
abbreviationField.setText("Abbreviation...");
|
||||
|
||||
abbreviationLabel.setText("Abbreviation:");
|
||||
|
||||
specialtyLabel.setText("Specialty Field:");
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(25, 25, 25)
|
||||
.addComponent(abbreviationLabel))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(21, 21, 21)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(abbreviationField, GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
|
||||
.addComponent(nameField)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(5, 5, 5)
|
||||
.addComponent(nameLabel)))
|
||||
.addGap(40, 40, 40)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(specialtyLabel)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cancelButton)
|
||||
.addGap(29, 29, 29)
|
||||
.addComponent(submitButton))
|
||||
.addComponent(specialtyCombo, GroupLayout.PREFERRED_SIZE, 173, GroupLayout.PREFERRED_SIZE))))
|
||||
.addContainerGap(30, Short.MAX_VALUE))
|
||||
.addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(titleLabel)
|
||||
.addGap(149, 149, 149)));
|
||||
layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(7, 7, 7)
|
||||
.addComponent(titleLabel)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(nameLabel).addComponent(specialtyLabel))
|
||||
.addGap(3, 3, 3)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(nameField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(specialtyCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(11, 11, 11)
|
||||
.addComponent(abbreviationLabel)
|
||||
.addGap(5, 5, 5)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(abbreviationField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(submitButton))
|
||||
.addContainerGap(24, Short.MAX_VALUE)));
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
private void submitButtonActionPerformed(ActionEvent evt) {
|
||||
String name = nameField.getText();
|
||||
String abbreviation = abbreviationField.getText();
|
||||
StudyField specialty = StudyField.getEnum(Objects.requireNonNull(specialtyCombo.getSelectedItem()).toString());
|
||||
Faculty newFaculty = new Faculty(name, abbreviation, specialty);
|
||||
sv.getFm().addFaculty(newFaculty);
|
||||
}
|
||||
|
||||
private void specialtyComboActionPerformed(ActionEvent evt) {
|
||||
abbreviationField.setText(StudyField.getAbbrevFromString(Objects.requireNonNull(specialtyCombo.getSelectedItem()).toString()));
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||
*/
|
||||
package org.lumijiez.gui.forms.faculty;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
public class EditFacultyForm extends JFrame {
|
||||
|
||||
private final Supervisor sv;
|
||||
private final JLabel mainTextLabel;
|
||||
private JTextField abbreviationField;
|
||||
private JLabel abbreviationLabel;
|
||||
private JButton cancelButton;
|
||||
private JComboBox<String> facultyCombo;
|
||||
private JLabel facultyLabel;
|
||||
private JTextField nameField;
|
||||
private JLabel nameLabel;
|
||||
private JComboBox<String> specialtyCombo;
|
||||
private JLabel specialtyLabel;
|
||||
private JButton submitButton;
|
||||
private JLabel titleLabel;
|
||||
public EditFacultyForm(Supervisor sv, JLabel mainTextLabel) {
|
||||
this.sv = sv;
|
||||
this.mainTextLabel = mainTextLabel;
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
||||
titleLabel = new JLabel();
|
||||
submitButton = new JButton();
|
||||
cancelButton = new JButton();
|
||||
nameLabel = new JLabel();
|
||||
nameField = new JTextField();
|
||||
facultyCombo = new JComboBox<>();
|
||||
facultyLabel = new JLabel();
|
||||
abbreviationLabel = new JLabel();
|
||||
abbreviationField = new JTextField();
|
||||
specialtyCombo = new JComboBox<>();
|
||||
specialtyLabel = new JLabel();
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
titleLabel.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
|
||||
titleLabel.setText("Edit a faculty");
|
||||
|
||||
submitButton.setBackground(new java.awt.Color(204, 255, 204));
|
||||
submitButton.setText("Submit");
|
||||
submitButton.addActionListener(this::submitButtonActionPerformed);
|
||||
|
||||
cancelButton.setBackground(new java.awt.Color(255, 204, 204));
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addActionListener(this::cancelButtonActionPerformed);
|
||||
|
||||
nameLabel.setText("New name:");
|
||||
|
||||
nameField.setText("Name...");
|
||||
|
||||
facultyCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
facultyLabel.setText("Faculty:");
|
||||
|
||||
abbreviationLabel.setText("New abbreviation:");
|
||||
|
||||
abbreviationField.setText("Abbreviation...");
|
||||
|
||||
specialtyCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
specialtyLabel.setText("New specialty:");
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(120, 120, 120)
|
||||
.addComponent(titleLabel))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(25, 25, 25)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(facultyLabel)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(specialtyLabel)
|
||||
.addComponent(facultyCombo, 0, 115, Short.MAX_VALUE)
|
||||
.addComponent(specialtyCombo, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(abbreviationLabel)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(abbreviationField, GroupLayout.PREFERRED_SIZE, 178, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(nameField, GroupLayout.PREFERRED_SIZE, 178, GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cancelButton)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(submitButton)))
|
||||
.addComponent(nameLabel))))))
|
||||
.addContainerGap(24, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(titleLabel)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(nameLabel)
|
||||
.addComponent(facultyLabel))
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(nameField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(facultyCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(abbreviationLabel)
|
||||
.addComponent(specialtyLabel))
|
||||
.addGap(5, 5, 5)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(abbreviationField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(specialtyCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(submitButton))
|
||||
.addGap(14, 14, 14))
|
||||
);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
private void submitButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||
*/
|
||||
package org.lumijiez.gui.forms.faculty;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
public class RemoveFacultyForm extends JFrame {
|
||||
|
||||
private final Supervisor sv;
|
||||
private final JLabel mainTextLabel;
|
||||
private JButton cancelButton;
|
||||
private JComboBox<String> facultyCombo;
|
||||
private JLabel facultyLabel;
|
||||
private JButton submitButton;
|
||||
private JLabel titleLabel;
|
||||
public RemoveFacultyForm(Supervisor sv, JLabel mainTextLabel) {
|
||||
this.sv = sv;
|
||||
this.mainTextLabel = mainTextLabel;
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
||||
titleLabel = new JLabel();
|
||||
submitButton = new JButton();
|
||||
cancelButton = new JButton();
|
||||
facultyCombo = new JComboBox<>();
|
||||
facultyLabel = new JLabel();
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
titleLabel.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
|
||||
titleLabel.setText("Remove a faculty");
|
||||
|
||||
submitButton.setBackground(new java.awt.Color(204, 255, 204));
|
||||
submitButton.setText("Submit");
|
||||
submitButton.addActionListener(this::submitButtonActionPerformed);
|
||||
|
||||
cancelButton.setBackground(new java.awt.Color(255, 204, 204));
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addActionListener(this::cancelButtonActionPerformed);
|
||||
|
||||
facultyCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
facultyLabel.setText("Faculty:");
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(22, 22, 22)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cancelButton)
|
||||
.addGap(38, 38, 38)
|
||||
.addComponent(submitButton))
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(facultyLabel)
|
||||
.addComponent(facultyCombo, GroupLayout.PREFERRED_SIZE, 181, GroupLayout.PREFERRED_SIZE)))
|
||||
.addContainerGap(32, Short.MAX_VALUE))
|
||||
.addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(titleLabel)
|
||||
.addGap(48, 48, 48))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(titleLabel)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(facultyLabel)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(facultyCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(submitButton))
|
||||
.addContainerGap(21, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
private void submitButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||
*/
|
||||
package org.lumijiez.gui.forms.faculty;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
public class ShowFacultyForm extends JFrame {
|
||||
|
||||
private final Supervisor sv;
|
||||
private final JLabel mainTextLabel;
|
||||
private JButton cancelButton;
|
||||
private JComboBox<String> facultyCombo;
|
||||
private JLabel facultyLabel;
|
||||
private JButton submitButton;
|
||||
private JLabel titleLabel;
|
||||
public ShowFacultyForm(Supervisor sv, JLabel mainTextLabel) {
|
||||
this.sv = sv;
|
||||
this.mainTextLabel = mainTextLabel;
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
||||
titleLabel = new JLabel();
|
||||
submitButton = new JButton();
|
||||
cancelButton = new JButton();
|
||||
facultyCombo = new JComboBox<>();
|
||||
facultyLabel = new JLabel();
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
titleLabel.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
|
||||
titleLabel.setText("Show a faculty");
|
||||
|
||||
submitButton.setBackground(new java.awt.Color(204, 255, 204));
|
||||
submitButton.setText("Submit");
|
||||
submitButton.addActionListener(this::submitButtonActionPerformed);
|
||||
|
||||
cancelButton.setBackground(new java.awt.Color(255, 204, 204));
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addActionListener(this::cancelButtonActionPerformed);
|
||||
|
||||
facultyCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
facultyLabel.setText("Faculty:");
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(46, 46, 46)
|
||||
.addComponent(titleLabel))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(26, 26, 26)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(facultyLabel)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
|
||||
.addGroup(GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addComponent(cancelButton)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(submitButton))
|
||||
.addComponent(facultyCombo, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 171, GroupLayout.PREFERRED_SIZE)))))
|
||||
.addContainerGap(27, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(13, 13, 13)
|
||||
.addComponent(titleLabel)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(facultyLabel)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(facultyCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(submitButton))
|
||||
.addContainerGap(24, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
private void submitButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||
*/
|
||||
package org.lumijiez.gui.forms.group;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
public class AddGroupForm extends JFrame {
|
||||
|
||||
private final Supervisor sv;
|
||||
private final JLabel mainTextLabel;
|
||||
|
||||
public AddGroupForm(Supervisor sv, JLabel mainTextLabel) {
|
||||
this.sv = sv;
|
||||
this.mainTextLabel = mainTextLabel;
|
||||
initComponents();
|
||||
}
|
||||
private void initComponents() {
|
||||
|
||||
JLabel titleLabel = new JLabel();
|
||||
JTextField nameField = new JTextField();
|
||||
JButton submitButton = new JButton();
|
||||
JButton cancelButton = new JButton();
|
||||
JLabel nameLabel = new JLabel();
|
||||
JComboBox<String> facultyCombo = new JComboBox<>();
|
||||
JLabel facultyLabel = new JLabel();
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
titleLabel.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
|
||||
titleLabel.setText("Add a new group");
|
||||
|
||||
nameField.setText("Name...");
|
||||
|
||||
submitButton.setBackground(new java.awt.Color(204, 255, 204));
|
||||
submitButton.setText("Submit");
|
||||
submitButton.addActionListener(this::submitButtonActionPerformed);
|
||||
|
||||
cancelButton.setBackground(new java.awt.Color(255, 204, 204));
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addActionListener(this::cancelButtonActionPerformed);
|
||||
|
||||
nameLabel.setText("Name:");
|
||||
|
||||
facultyCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
facultyLabel.setText("Faculty:");
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(21, 21, 21)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(nameField, GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(5, 5, 5)
|
||||
.addComponent(nameLabel))
|
||||
.addComponent(facultyLabel)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cancelButton)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(submitButton))
|
||||
.addComponent(facultyCombo, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(38, 38, 38)
|
||||
.addComponent(titleLabel)))
|
||||
.addContainerGap(29, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(titleLabel)
|
||||
.addGap(13, 13, 13)
|
||||
.addComponent(nameLabel)
|
||||
.addGap(3, 3, 3)
|
||||
.addComponent(nameField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(facultyLabel)
|
||||
.addGap(5, 5, 5)
|
||||
.addComponent(facultyCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(submitButton))
|
||||
.addGap(15, 15, 15))
|
||||
);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
private void submitButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||
*/
|
||||
package org.lumijiez.gui.forms.group;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
public class DeleteGroupForm extends JFrame {
|
||||
private final Supervisor sv;
|
||||
private final JLabel mainTextLabel;
|
||||
private JButton cancelButton;
|
||||
private JComboBox<String> groupCombo;
|
||||
private JLabel groupLabel;
|
||||
private JButton submitButton;
|
||||
private JLabel titleLabel;
|
||||
public DeleteGroupForm(Supervisor sv, JLabel mainTextLabel) {
|
||||
this.sv = sv;
|
||||
this.mainTextLabel = mainTextLabel;
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
||||
titleLabel = new JLabel();
|
||||
groupCombo = new JComboBox<>();
|
||||
submitButton = new JButton();
|
||||
cancelButton = new JButton();
|
||||
groupLabel = new JLabel();
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
titleLabel.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
|
||||
titleLabel.setText("Delete a group");
|
||||
|
||||
groupCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
submitButton.setBackground(new java.awt.Color(204, 255, 204));
|
||||
submitButton.setText("Submit");
|
||||
submitButton.addActionListener(this::submitButtonActionPerformed);
|
||||
|
||||
cancelButton.setBackground(new java.awt.Color(255, 204, 204));
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addActionListener(this::cancelButtonActionPerformed);
|
||||
|
||||
groupLabel.setText("Group:");
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(23, 23, 23)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(groupLabel)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
|
||||
.addGroup(GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addComponent(cancelButton)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(submitButton))
|
||||
.addComponent(groupCombo, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 175, GroupLayout.PREFERRED_SIZE))))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(54, 54, 54)
|
||||
.addComponent(titleLabel)))
|
||||
.addContainerGap(29, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(titleLabel)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(groupLabel)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(groupCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(submitButton))
|
||||
.addContainerGap(18, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
private void submitButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
this.dispose();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||
*/
|
||||
package org.lumijiez.gui.forms.group;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
public class EditGroupForm extends JFrame {
|
||||
|
||||
private final Supervisor sv;
|
||||
private final JLabel mainTextLabel;
|
||||
private JButton cancelButton;
|
||||
private JComboBox<String> facultyCombo;
|
||||
private JLabel facultyLabel;
|
||||
private JComboBox<String> groupCombo;
|
||||
private JLabel groupLabel;
|
||||
private JTextField nameField;
|
||||
private JLabel nameLabel;
|
||||
private JButton submitButton;
|
||||
private JLabel titleLabel;
|
||||
public EditGroupForm(Supervisor sv, JLabel mainTextLabel) {
|
||||
this.sv = sv;
|
||||
this.mainTextLabel = mainTextLabel;
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
||||
titleLabel = new JLabel();
|
||||
groupCombo = new JComboBox<>();
|
||||
nameField = new JTextField();
|
||||
submitButton = new JButton();
|
||||
cancelButton = new JButton();
|
||||
nameLabel = new JLabel();
|
||||
facultyCombo = new JComboBox<>();
|
||||
groupLabel = new JLabel();
|
||||
facultyLabel = new JLabel();
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
titleLabel.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
|
||||
titleLabel.setText("Edit a group");
|
||||
|
||||
groupCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
nameField.setText("Name...");
|
||||
|
||||
submitButton.setBackground(new java.awt.Color(204, 255, 204));
|
||||
submitButton.setText("Submit");
|
||||
submitButton.addActionListener(this::submitButtonActionPerformed);
|
||||
|
||||
cancelButton.setBackground(new java.awt.Color(255, 204, 204));
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addActionListener(this::cancelButtonActionPerformed);
|
||||
|
||||
nameLabel.setText("New name:");
|
||||
|
||||
facultyCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
groupLabel.setText("Group:");
|
||||
|
||||
facultyLabel.setText("Faculty:");
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(25, 25, 25)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(129, 129, 129)
|
||||
.addComponent(titleLabel))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(cancelButton)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(groupCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(groupLabel))
|
||||
.addGap(34, 34, 34)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(nameField, GroupLayout.PREFERRED_SIZE, 178, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(nameLabel))))
|
||||
.addGap(27, 27, 27)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(facultyLabel)
|
||||
.addComponent(facultyCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(submitButton))))
|
||||
.addContainerGap(34, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(7, 7, 7)
|
||||
.addComponent(titleLabel)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(35, 35, 35)
|
||||
.addComponent(facultyCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(15, 15, 15)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(nameLabel)
|
||||
.addComponent(groupLabel)
|
||||
.addComponent(facultyLabel))
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(nameField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(groupCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
|
||||
.addGap(31, 31, 31)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(submitButton))
|
||||
.addContainerGap(36, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
private void submitButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||
*/
|
||||
package org.lumijiez.gui.forms.group;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
|
||||
public class ShowGroupForm extends JFrame {
|
||||
|
||||
private final Supervisor sv;
|
||||
private final JLabel mainTextLabel;
|
||||
private JButton cancelButton;
|
||||
private JComboBox<String> groupCombo;
|
||||
private JLabel groupLabel;
|
||||
private JButton submitButton;
|
||||
private JLabel titleLabel;
|
||||
public ShowGroupForm(Supervisor sv, JLabel mainTextLabel) {
|
||||
this.sv = sv;
|
||||
this.mainTextLabel = mainTextLabel;
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
||||
titleLabel = new JLabel();
|
||||
groupCombo = new JComboBox<>();
|
||||
submitButton = new JButton();
|
||||
cancelButton = new JButton();
|
||||
groupLabel = new JLabel();
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
titleLabel.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
|
||||
titleLabel.setText("Show a group");
|
||||
|
||||
groupCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
submitButton.setBackground(new java.awt.Color(204, 255, 204));
|
||||
submitButton.setText("Submit");
|
||||
submitButton.addActionListener(this::submitButtonActionPerformed);
|
||||
|
||||
cancelButton.setBackground(new java.awt.Color(255, 204, 204));
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addActionListener(this::cancelButtonActionPerformed);
|
||||
|
||||
groupLabel.setText("Group:");
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(25, 25, 25)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(groupLabel)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cancelButton)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(submitButton))
|
||||
.addComponent(groupCombo, GroupLayout.PREFERRED_SIZE, 169, GroupLayout.PREFERRED_SIZE))))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(47, 47, 47)
|
||||
.addComponent(titleLabel)))
|
||||
.addContainerGap(24, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(titleLabel)
|
||||
.addGap(15, 15, 15)
|
||||
.addComponent(groupLabel)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(groupCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(submitButton))
|
||||
.addContainerGap(25, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
private void submitButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
this.dispose();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||
*/
|
||||
package org.lumijiez.gui.forms.student;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
import org.lumijiez.util.FullStudentData;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
public class AddStudentForm extends JFrame {
|
||||
|
||||
private final Supervisor sv;
|
||||
private final JLabel mainTextLabel;
|
||||
private JButton cancelButton;
|
||||
private JTextField emailField;
|
||||
private JLabel emailLabel;
|
||||
private JComboBox<String> facultyCombo;
|
||||
private JLabel facultyLabel;
|
||||
private JComboBox<String> groupCombo;
|
||||
private JLabel groupLabel;
|
||||
private JTextField nameField;
|
||||
private JLabel nameLabel;
|
||||
private JButton submitButton;
|
||||
private JTextField surnameField;
|
||||
private JLabel surnameLabel;
|
||||
private JLabel titleLabel;
|
||||
|
||||
public AddStudentForm(Supervisor sv, JLabel mainTextLabel) {
|
||||
this.sv = sv;
|
||||
this.mainTextLabel = mainTextLabel;
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
||||
titleLabel = new JLabel();
|
||||
groupCombo = new JComboBox<>();
|
||||
nameField = new JTextField();
|
||||
submitButton = new JButton();
|
||||
cancelButton = new JButton();
|
||||
nameLabel = new JLabel();
|
||||
surnameField = new JTextField();
|
||||
emailField = new JTextField();
|
||||
surnameLabel = new JLabel();
|
||||
emailLabel = new JLabel();
|
||||
facultyCombo = new JComboBox<>();
|
||||
groupLabel = new JLabel();
|
||||
facultyLabel = new JLabel();
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
titleLabel.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
|
||||
titleLabel.setText("Add a new student");
|
||||
|
||||
groupCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
nameField.setText("Name...");
|
||||
|
||||
submitButton.setBackground(new java.awt.Color(204, 255, 204));
|
||||
submitButton.setText("Submit");
|
||||
submitButton.addActionListener(this::submitButtonActionPerformed);
|
||||
|
||||
cancelButton.setBackground(new java.awt.Color(255, 204, 204));
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addActionListener(this::cancelButtonActionPerformed);
|
||||
|
||||
nameLabel.setText("Name:");
|
||||
|
||||
surnameField.setText("Surname...");
|
||||
|
||||
emailField.setText("Email...");
|
||||
|
||||
surnameLabel.setText("Surname:");
|
||||
|
||||
emailLabel.setText("Email:");
|
||||
|
||||
facultyCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
groupLabel.setText("Group:");
|
||||
|
||||
facultyLabel.setText("Faculty:");
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(132, 132, 132)
|
||||
.addComponent(titleLabel))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(25, 25, 25)
|
||||
.addComponent(surnameLabel)
|
||||
.addGap(142, 142, 142)
|
||||
.addComponent(emailLabel)))
|
||||
.addGap(69, 138, Short.MAX_VALUE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(21, 21, 21)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(surnameField, GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
|
||||
.addComponent(nameField)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(5, 5, 5)
|
||||
.addComponent(nameLabel)))
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(groupLabel)
|
||||
.addGap(67, 67, 67)
|
||||
.addComponent(facultyLabel)
|
||||
.addGap(51, 51, 51))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cancelButton)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(submitButton))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(groupCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(34, 34, 34)
|
||||
.addComponent(facultyCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(emailField, GroupLayout.PREFERRED_SIZE, 178, GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(titleLabel)
|
||||
.addGap(13, 13, 13)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(nameLabel)
|
||||
.addComponent(groupLabel)
|
||||
.addComponent(facultyLabel))
|
||||
.addGap(3, 3, 3)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(nameField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(groupCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(facultyCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(11, 11, 11)
|
||||
.addComponent(surnameLabel)
|
||||
.addGap(5, 5, 5))
|
||||
.addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(emailLabel)
|
||||
.addGap(4, 4, 4)))
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(surnameField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(emailField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(38, 38, 38)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(submitButton))
|
||||
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pack();
|
||||
}
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
private void submitButtonActionPerformed(ActionEvent evt) {
|
||||
String name = nameField.getText();
|
||||
String surname = surnameField.getText();
|
||||
FullStudentData data = new FullStudentData(name, surname, "group", "faculty");
|
||||
if (!name.isEmpty() && !surname.isEmpty()) {
|
||||
sv.getFm().getGm().getSm().addStudent(data, sv);
|
||||
mainTextLabel.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.");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||
*/
|
||||
package org.lumijiez.gui.forms.student;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
public class DeleteStudentForm extends JFrame {
|
||||
private final Supervisor sv;
|
||||
private final JLabel mainTextLabel;
|
||||
private JButton cancelButton;
|
||||
private JComboBox<String> studentCombo;
|
||||
private JLabel studentLabel;
|
||||
private JButton submitButton;
|
||||
private JLabel titleLabel;
|
||||
public DeleteStudentForm(Supervisor sv, JLabel mainTextLabel) {
|
||||
this.sv = sv;
|
||||
this.mainTextLabel = mainTextLabel;
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
||||
titleLabel = new JLabel();
|
||||
studentCombo = new JComboBox<>();
|
||||
submitButton = new JButton();
|
||||
cancelButton = new JButton();
|
||||
studentLabel = new JLabel();
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
titleLabel.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
|
||||
titleLabel.setText("Delete Student");
|
||||
|
||||
studentCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
submitButton.setBackground(new java.awt.Color(204, 255, 204));
|
||||
submitButton.setText("Submit");
|
||||
submitButton.addActionListener(this::submitButtonActionPerformed);
|
||||
|
||||
cancelButton.setBackground(new java.awt.Color(255, 204, 204));
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addActionListener(this::cancelButtonActionPerformed);
|
||||
|
||||
studentLabel.setText("Student:");
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(21, 21, 21)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cancelButton)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(submitButton))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(5, 5, 5)
|
||||
.addComponent(studentLabel))
|
||||
.addComponent(studentCombo, GroupLayout.PREFERRED_SIZE, 178, GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(26, Short.MAX_VALUE))
|
||||
.addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(titleLabel)
|
||||
.addGap(51, 51, 51))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(7, 7, 7)
|
||||
.addComponent(titleLabel)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(studentLabel)
|
||||
.addGap(3, 3, 3)
|
||||
.addComponent(studentCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(submitButton)
|
||||
.addComponent(cancelButton))
|
||||
.addContainerGap(26, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
private void submitButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
this.dispose();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||
*/
|
||||
package org.lumijiez.gui.forms.student;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
public class EditStudentForm extends JFrame {
|
||||
|
||||
private final Supervisor sv;
|
||||
private final JLabel mainTextLabel;
|
||||
private JButton cancelButton;
|
||||
private JTextField emailField;
|
||||
private JLabel emailLabel;
|
||||
private JComboBox<String> facultyCombo;
|
||||
private JLabel facultyLabel;
|
||||
private JComboBox<String> groupCombo;
|
||||
private JLabel groupLabel;
|
||||
private JTextField nameField;
|
||||
private JLabel nameLabel;
|
||||
private JComboBox<String> studentCombo;
|
||||
private JLabel studentLabel;
|
||||
private JButton submitButton;
|
||||
private JTextField surnameField;
|
||||
private JLabel surnameLabel;
|
||||
private JLabel titleLabel;
|
||||
public EditStudentForm(Supervisor sv, JLabel mainTextLabel) {
|
||||
this.sv = sv;
|
||||
this.mainTextLabel = mainTextLabel;
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
||||
titleLabel = new JLabel();
|
||||
studentCombo = new JComboBox<>();
|
||||
nameField = new JTextField();
|
||||
submitButton = new JButton();
|
||||
cancelButton = new JButton();
|
||||
studentLabel = new JLabel();
|
||||
surnameField = new JTextField();
|
||||
emailField = new JTextField();
|
||||
nameLabel = new JLabel();
|
||||
emailLabel = new JLabel();
|
||||
groupCombo = new JComboBox<>();
|
||||
groupLabel = new JLabel();
|
||||
facultyLabel = new JLabel();
|
||||
surnameLabel = new JLabel();
|
||||
facultyCombo = new JComboBox<>();
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
titleLabel.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
|
||||
titleLabel.setText("Edit a student");
|
||||
|
||||
studentCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
nameField.setText("Name...");
|
||||
|
||||
submitButton.setBackground(new java.awt.Color(204, 255, 204));
|
||||
submitButton.setText("Submit");
|
||||
submitButton.addActionListener(this::submitButtonActionPerformed);
|
||||
|
||||
cancelButton.setBackground(new java.awt.Color(255, 204, 204));
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addActionListener(this::cancelButtonActionPerformed);
|
||||
|
||||
studentLabel.setText("Student:");
|
||||
|
||||
surnameField.setText("Surname...");
|
||||
|
||||
emailField.setText("Email...");
|
||||
|
||||
nameLabel.setText("New name:");
|
||||
|
||||
emailLabel.setText("New email:");
|
||||
|
||||
groupCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
groupLabel.setText("New group:");
|
||||
|
||||
facultyLabel.setText("New faculty:");
|
||||
|
||||
surnameLabel.setText("New surname:");
|
||||
|
||||
facultyCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(26, 26, 26)
|
||||
.addComponent(studentLabel))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(25, 25, 25)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(surnameLabel)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(surnameField, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
|
||||
.addComponent(nameLabel)
|
||||
.addComponent(nameField, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
|
||||
.addComponent(studentCombo, GroupLayout.Alignment.TRAILING, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGap(36, 36, 36)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(emailLabel)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cancelButton)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(submitButton))
|
||||
.addComponent(emailField, GroupLayout.PREFERRED_SIZE, 178, GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(groupCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(groupLabel))
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(facultyLabel)
|
||||
.addComponent(facultyCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))))))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(162, 162, 162)
|
||||
.addComponent(titleLabel)))
|
||||
.addContainerGap(24, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(13, 13, 13)
|
||||
.addComponent(titleLabel)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(studentLabel)
|
||||
.addComponent(groupLabel)
|
||||
.addComponent(facultyLabel))
|
||||
.addGap(3, 3, 3)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(studentCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(groupCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(facultyCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(12, 12, 12)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(emailLabel)
|
||||
.addComponent(nameLabel))
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(nameField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(emailField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(surnameLabel)
|
||||
.addGap(3, 3, 3)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(surnameField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(submitButton))
|
||||
.addContainerGap(24, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
private void submitButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||
*/
|
||||
package org.lumijiez.gui.forms.student;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
public class GradeStudentForm extends JFrame {
|
||||
|
||||
private final Supervisor sv;
|
||||
private final JLabel mainTextLabel;
|
||||
private JButton cancelButton;
|
||||
private JTextField gradeField;
|
||||
private JLabel gradeLabel;
|
||||
private JComboBox<String> studentCombo;
|
||||
private JLabel studentLabel;
|
||||
private JComboBox<String> subjectCombo;
|
||||
private JLabel subjectLabel;
|
||||
private JButton submitButton;
|
||||
private JLabel titleLabel;
|
||||
|
||||
public GradeStudentForm(Supervisor sv, JLabel mainTextLabel) {
|
||||
this.sv = sv;
|
||||
this.mainTextLabel = mainTextLabel;
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
||||
titleLabel = new JLabel();
|
||||
studentCombo = new JComboBox<>();
|
||||
submitButton = new JButton();
|
||||
cancelButton = new JButton();
|
||||
subjectLabel = new JLabel();
|
||||
subjectCombo = new JComboBox<>();
|
||||
studentLabel = new JLabel();
|
||||
gradeField = new JTextField();
|
||||
gradeLabel = new JLabel();
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
titleLabel.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
|
||||
titleLabel.setText("Grade a student");
|
||||
|
||||
studentCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
submitButton.setBackground(new java.awt.Color(204, 255, 204));
|
||||
submitButton.setText("Submit");
|
||||
submitButton.addActionListener(this::submitButtonActionPerformed);
|
||||
|
||||
cancelButton.setBackground(new java.awt.Color(255, 204, 204));
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addActionListener(this::cancelButtonActionPerformed);
|
||||
|
||||
subjectLabel.setText("Subject:");
|
||||
|
||||
subjectCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
studentLabel.setText("Student:");
|
||||
|
||||
gradeField.setText("Grade...");
|
||||
|
||||
gradeLabel.setText("Grade:");
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(25, 25, 25)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(gradeLabel)
|
||||
.addContainerGap())
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addComponent(studentCombo, GroupLayout.PREFERRED_SIZE, 147, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(studentLabel)
|
||||
.addComponent(gradeField, GroupLayout.PREFERRED_SIZE, 147, GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE)
|
||||
.addComponent(subjectLabel)
|
||||
.addGap(148, 148, 148))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cancelButton)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(submitButton))
|
||||
.addComponent(subjectCombo, GroupLayout.PREFERRED_SIZE, 160, GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(129, 129, 129)
|
||||
.addComponent(titleLabel)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(7, 7, 7)
|
||||
.addComponent(titleLabel)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(subjectLabel)
|
||||
.addComponent(studentLabel))
|
||||
.addGap(3, 3, 3)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(studentCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(subjectCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(gradeLabel)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(gradeField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(submitButton))
|
||||
.addContainerGap(30, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
private void submitButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||
*/
|
||||
package org.lumijiez.gui.forms.student;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
public class ShowStudentForm extends JFrame {
|
||||
|
||||
private final Supervisor sv;
|
||||
private final JLabel mainTextLabel;
|
||||
private JButton cancelButton;
|
||||
private JComboBox<String> studentCombo;
|
||||
private JLabel studentLabel;
|
||||
private JButton submitButton;
|
||||
private JLabel titleLabel;
|
||||
|
||||
public ShowStudentForm(Supervisor sv, JLabel mainTextLabel) {
|
||||
this.sv = sv;
|
||||
this.mainTextLabel = mainTextLabel;
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
||||
titleLabel = new JLabel();
|
||||
studentCombo = new JComboBox<>();
|
||||
submitButton = new JButton();
|
||||
cancelButton = new JButton();
|
||||
studentLabel = new JLabel();
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
titleLabel.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
|
||||
titleLabel.setText("Show Student");
|
||||
|
||||
studentCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
submitButton.setBackground(new java.awt.Color(204, 255, 204));
|
||||
submitButton.setText("Submit");
|
||||
submitButton.addActionListener(this::submitButtonActionPerformed);
|
||||
|
||||
cancelButton.setBackground(new java.awt.Color(255, 204, 204));
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addActionListener(this::cancelButtonActionPerformed);
|
||||
|
||||
studentLabel.setText("Student:");
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(21, 21, 21)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(5, 5, 5)
|
||||
.addComponent(studentLabel))
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cancelButton)
|
||||
.addGap(34, 34, 34)
|
||||
.addComponent(submitButton))
|
||||
.addComponent(studentCombo, GroupLayout.PREFERRED_SIZE, 178, GroupLayout.PREFERRED_SIZE))))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(52, 52, 52)
|
||||
.addComponent(titleLabel)))
|
||||
.addContainerGap(23, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(titleLabel)
|
||||
.addGap(13, 13, 13)
|
||||
.addComponent(studentLabel)
|
||||
.addGap(3, 3, 3)
|
||||
.addComponent(studentCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(submitButton))
|
||||
.addContainerGap(22, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
private void submitButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
|
||||
*/
|
||||
package org.lumijiez.gui.forms.student;
|
||||
|
||||
import org.lumijiez.managers.Supervisor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
public class ShowStudentGradesForm extends JFrame {
|
||||
|
||||
private final Supervisor sv;
|
||||
private final JLabel mainTextLabel;
|
||||
private JButton cancelButton;
|
||||
private JComboBox<String> studentCombo;
|
||||
private JLabel studentLabel;
|
||||
private JButton submitButton;
|
||||
private JLabel titleLabel;
|
||||
|
||||
|
||||
public ShowStudentGradesForm(Supervisor sv, JLabel mainTextLabel) {
|
||||
this.sv = sv;
|
||||
this.mainTextLabel = mainTextLabel;
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
||||
titleLabel = new JLabel();
|
||||
studentCombo = new JComboBox<>();
|
||||
submitButton = new JButton();
|
||||
cancelButton = new JButton();
|
||||
studentLabel = new JLabel();
|
||||
|
||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||
|
||||
titleLabel.setFont(new java.awt.Font("sansserif", 0, 18)); // NOI18N
|
||||
titleLabel.setText("Show Grades");
|
||||
|
||||
studentCombo.setModel(new DefaultComboBoxModel<>(new String[]{"Item 1", "Item 2", "Item 3", "Item 4"}));
|
||||
|
||||
submitButton.setBackground(new java.awt.Color(204, 255, 204));
|
||||
submitButton.setText("Submit");
|
||||
submitButton.addActionListener(this::submitButtonActionPerformed);
|
||||
|
||||
cancelButton.setBackground(new java.awt.Color(255, 204, 204));
|
||||
cancelButton.setText("Cancel");
|
||||
cancelButton.addActionListener(this::cancelButtonActionPerformed);
|
||||
|
||||
studentLabel.setText("Student:");
|
||||
|
||||
GroupLayout layout = new GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(21, 21, 21)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(5, 5, 5)
|
||||
.addComponent(studentLabel))
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cancelButton)
|
||||
.addGap(34, 34, 34)
|
||||
.addComponent(submitButton))
|
||||
.addComponent(studentCombo, GroupLayout.PREFERRED_SIZE, 178, GroupLayout.PREFERRED_SIZE))))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(50, 50, 50)
|
||||
.addComponent(titleLabel)))
|
||||
.addContainerGap(30, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(7, 7, 7)
|
||||
.addComponent(titleLabel)
|
||||
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(studentLabel)
|
||||
.addGap(3, 3, 3)
|
||||
.addComponent(studentCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cancelButton)
|
||||
.addComponent(submitButton))
|
||||
.addContainerGap(22, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
private void submitButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user