JDDDD
JDDDD
*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
public GradingSystemGUI() {
frame.setSize(700, 500);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new BorderLayout());
panel1.add(new JLabel("Name:"));
panel1.add(nameField);
panel1.add(new JLabel("Section:"));
panel1.add(sectionField);
panel1.add(addStudentBtn);
panel2.add(new JLabel("Subject:"));
panel2.add(subjectField);
panel2.add(new JLabel("Grade:"));
panel2.add(gradeField);
panel2.add(addGradeBtn);
resultArea.setEditable(false);
searchPanel.add(new JLabel("Search:"));
searchPanel.add(searchField);
searchPanel.add(searchBtn);
panel3.add(searchPanel, BorderLayout.NORTH);
frame.add(panel1, BorderLayout.NORTH);
frame.add(panel2, BorderLayout.CENTER);
frame.add(panel3, BorderLayout.SOUTH);
addStudentBtn.addActionListener(new ActionListener() {
String id = studentIdField.getText().trim();
return;
studentIdField.setText("");
nameField.setText("");
sectionField.setText("");
}
});
addGradeBtn.addActionListener(new ActionListener() {
try {
String id = studentIdField.getText().trim();
if (id.isEmpty() || subject.isEmpty()) {
return;
subjectField.setText("");
gradeField.setText("");
});
searchBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
resultArea.setText("");
} else {
});
frame.setVisible(true);
new GradingSystemGUI();