Program:
import javax.swing.*;
public class TableExample
public class TableExample
{
JFrame f;
TableExample()
JFrame f;
TableExample()
{
f=new JFrame();
String data[][]={ {"MIT College","Pune","No"},
{"Government Polytechnic, Pune","Pune","Yes"},
{"Government Polytechnic,Satara","SAtara","Yes"}};
String column[]={"College","City","Autonomous"};
JTable jt=new JTable(data,column);
jt.setBounds(30,40,200,400);
JScrollPane sp=new JScrollPane(jt);
f.add(sp);
f.setSize(500,270);
f.setVisible(true);
}
public static void main(String[] args) {
new TableExample();
}
}
f=new JFrame();
String data[][]={ {"MIT College","Pune","No"},
{"Government Polytechnic, Pune","Pune","Yes"},
{"Government Polytechnic,Satara","SAtara","Yes"}};
String column[]={"College","City","Autonomous"};
JTable jt=new JTable(data,column);
jt.setBounds(30,40,200,400);
JScrollPane sp=new JScrollPane(jt);
f.add(sp);
f.setSize(500,270);
f.setVisible(true);
}
public static void main(String[] args) {
new TableExample();
}
}
Comments
Post a Comment
If there are specific topics you'd like articles on, please don't hesitate to inform me. I'll gladly publish content tailored to your preferences.