Ex 4
Ex 4
Aim:
To create a student information system using java swing that collects and displays personal and academic
information across multiple tabs.
Algorithm:
Step-1: Create a window with a tabbed pane containing three tabs: one for personal information,
one for academic information, and one for summary details.
Step-2: In the personal information tab, add labeled text fields for first name, last name, and age;
radio buttons for gender selection; and checkboxes for skill selection. Add a "Next" button to navigate
to the academic information tab.
Step-3: In the academic information tab, add labeled text fields for college name and CGPA; dropdown menus
for degree and graduation year; and buttons for navigating back to the personal information tab and
forward to the summary tab.
Step-4: In the summary tab, add a text area to display the input details and a "Submit" button to finalize the
registration. Make the text area non-editable and add a scroll pane for it.
Program:
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class StudentInformationSystem extends JFrame implements ActionListener {
JTabbedPane tabbedPane;
JPanel personalPanel, academicPanel, finalPanel;
JTextField firstNameField, lastNameField, ageField;
JRadioButton maleButton, femaleButton, otherButton;
JCheckBox javaCheckBox, pythonCheckBox, cppCheckBox;
JComboBox<String> yearComboBox, degreeComboBox;
JTextField collegeNameField, cgpaField;
JButton nextButton1, nextButton2, backButton, submitButton;
JTextArea resultArea;
ButtonGroup genderGroup;
StudentInformationSystem() {
setTitle("Student Information System");
setSize(500, 500);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
tabbedPane = new JTabbedPane();