Professional Documents
Culture Documents
Program - 8 // Writr A Program To Cerate A Table of Name of Student, Percentage and Grade of 10 Student Using Jtable
Program - 8 // Writr A Program To Cerate A Table of Name of Student, Percentage and Grade of 10 Student Using Jtable
// writr a program to
cerate a table of name of
student, Percentage and
grade of 10 student using
JTable
public class exer1 extends JFrame {
exer1() {
Container c = getContentPane();
c.setLayout(new BorderLayout());
String Title[] = { "Name", "Percentage", "Grade" };
Object Data[][] = {
{ "Swayam", "89", "A" },
{ "ManasI", "93", "B" },
{ "ManaN", "44", "B" },
{ "Manav", "34", "C" },
{ "Yash", "64", "B" },
{ "Pranav", "74", "B" },
{ "Smit", "85", "A" },
{ "Siddhant", "61", "C" },
{ "Jailal", "92", "A" },
{ "Shreyas", "24", "D" },
};
JTable jt = new JTable(Data, Title);
int v = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
int h = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED; JScrollPane jsp
= new JScrollPane(jt, v, h);
c.add(jsp, BorderLayout.WEST);
}