0% found this document useful (0 votes)
9 views1 page

View Student Details

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

View Student Details

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

package School_Management_System;

import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.sql.*;
public class ViewStudentDetails extends JFrame
{
String x[]={"Name","Username","Email","Father
Name","Phone","section","class","Gender","Blood Group","DOB","Roll_no"};
String y[][]=new String[20][13];
int i=0,j=0;
JTable t;
Font f;
ViewStudentDetails()
{super("Teacher Information");
setSize(1500,400);
setLocation(1, 1);
f=new Font("Arial",Font.BOLD,15);
try
{ ConnectionClass obj=new ConnectionClass();
String q="Select*from student";
ResultSet rest =obj.stm.executeQuery(q);
while (rest.next())
{ y[i][j++]=rest.getString("name");
y[i][j++]=rest.getString("username");
y[i][j++]=rest.getString("email");
y[i][j++]=rest.getString("father_name");
y[i][j++]=rest.getString("phone");
y[i][j++]=rest.getString("section");
y[i][j++]=rest.getString("class");
y[i][j++]=rest.getString("gender");
y[i][j++]=rest.getString("blood");
y[i][j++]=rest.getString("dob");
y[i][j++]=rest.getString("roll_no");
i++;
j=0;}
t=new JTable(y,x);
t.setFont(f);
t.setForeground(Color.BLACK);
t.setBackground(Color.WHITE);
JScrollPane sp=new JScrollPane(t);
add(sp);
} catch (Exception ex)
{ ex.printStackTrace();} }
public static void main(String[] args)
{ new ViewStudentDetails().setVisible(true); }}

You might also like