0% found this document useful (0 votes)
6 views3 pages

Practical 8

Uploaded by

Payal Jadhav
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)
6 views3 pages

Practical 8

Uploaded by

Payal Jadhav
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/ 3

Practical 8

Write a Program to Create JTable.


import java.awt.*; import javax.swing.*;

/*<applet code="Practical8" width=600 height=500>

</applet>*/ public class Practical8 extends

JApplet

public void start()

Container ct=getContentPane(); ct.setLayout(new

BorderLayout());

final String[]colHeads={"RollNo","Name","City","MobileNo"};

final Object[][]data={

{"1","Payal","Pune","996055"} ,

{"2","Riya","Bhor","963555"},

{"3","Arya","Sangali","75323"},

{"4","Sakshi","Latur","97564"},

{"5","Mansi","Kolhapur","85647"},

{"6","Ram","Thane","76453"},

{"7","Shweta","Nashik","98643"},

{"8","Swati","Baramati","64734"},

{"9","Prerna","Indoor","74834"},

{"10","Kranti","Gujrat","65856"}

};
JTable table=new JTable(data,colHeads); int

v=ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED; int

h=ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;

JScrollPane jsp=new JScrollPane(table,v,h);

ct.add(jsp,BorderLayout.CENTER);

You might also like