0% found this document useful (0 votes)
4 views7 pages

Ajp Micro

The document outlines a web application for registering and displaying a list of students, featuring a user-friendly interface and responsive design. It includes source code for a Java Swing application that allows users to input student names and ages, manage pagination, and display registered students. Additionally, it provides references for further reading on related topics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views7 pages

Ajp Micro

The document outlines a web application for registering and displaying a list of students, featuring a user-friendly interface and responsive design. It includes source code for a Java Swing application that allows users to input student names and ages, manage pagination, and display registered students. Additionally, it provides references for further reading on related topics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

INDEX

SR. TOPIC PAGE


NO. NO.
1. Introduction 2
5. Source Code 3-5
6. Output 6
9. References 7

1
Technologies Used: The Apache NetBeans Platform is a generic framework for Swing
applications. It provides the "plumbing" that, before, every developer had to write
themselves—saving state, connecting actions to menu items, toolbar items and keyboard
shortcuts; window management.
User Interface Design
Clean Layout: Simple and intuitive design for easy navigation.
Responsive Design: Works well on desktops, tablets, and smartphones.
Input Fields.
Amount Input: A text field for users to enter the value they want to convert.
INTRODUCTION

The Register and Display list of Students web application provides users with a
simple and intuitive interfere for Register and Display
Use for register with name and age of students and display in sequence in order of
10 elements on one page This tool is designed
OBJECTIVES
User-Friendly Interface : Develop a clean and responsive layout that enhances user
experience across
devices.
Error Handling: Provide clear error messages for invalid inputs and unsupported
datatypes.

2
SOURCE CODE

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

public class NewClass extends JFrame {


private ArrayList<Student> students = new ArrayList<>();
private JTextArea displayArea;
private JTextField nameField, ageField;
private JButton registerButton, nextButton, prevButton;
private int currentPage = 0;
private static final int PAGE_SIZE = 10;

public NewClass() {
setTitle("Student Registration");
setLayout(new FlowLayout());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(400, 300);

nameField = new JTextField(10);


ageField = new JTextField(10);
registerButton = new JButton("Register");
nextButton = new JButton("Next");
prevButton = new JButton("Previous");
displayArea = new JTextArea(10, 10);
displayArea.setEditable(false);

registerButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
registerStudent();
displayStudents();
}
});
3
nextButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if ((currentPage + 1) * PAGE_SIZE < students.size()) {
currentPage++;
displayStudents();
}
}
});

prevButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (currentPage > 0) {
currentPage--;
displayStudents();
}
}
});

add(new JLabel("Name:"));
add(nameField);
add(new JLabel("Age:"));
add(ageField);
add(registerButton);
add(prevButton);
add(nextButton);
add(new JScrollPane(displayArea));

setVisible(true);
}

private void registerStudent() {


String name = nameField.getText();
int age = Integer.parseInt(ageField.getText());
students.add(new Student(name, age));
nameField.setText("");
ageField.setText("");
}
4
private void displayStudents() {
displayArea.setText("");
int start = currentPage * PAGE_SIZE;
int end = Math.min(start + PAGE_SIZE, students.size());
for (int i = start; i < end; i++) {
displayArea.append(students.get(i).toString() + "\n");
}
}

public static void main(String[] args) {


new NewClass();
}
}

public class Student {


private String name;
private int age;

public Student(String name, int age) {


this.name = name;
this.age = age;
}

public String getName() {


return name;
}

public int getAge() {


return age;
}

@Override
public String toString() {
return "Name: " + name + ", Age: " + age;
}
}

5
OUTPUT

6
REFERENCES

 https://www.ilovepdf.com/pdf_to_word
 https://www.javatpoint.com/example-of-
registration-form-in-servlet
 https://www.geeksforgeeks.org/java-swing-
simple-user-registration-form/

You might also like