Question :
3. Write a java program to display BCA 5 th sem timetable using JTable class of swing.
File name : Program3
import javax.swing.*;
import javax.swing.event.*;
public class Program3 {
Program3(){
JFrame f = new JFrame("BCA 5th sem :Time table ");
String data[][]={ {"MONADY"," ","DC","OS","CN","OS"},
{"TUESDAY","CN","OS","WEBLAB","WEBLAB","WEBLAB"},
{"WEDNESDAY","WEB","AJAVA", "AJAVALAB","AJAVALAB","AJAVALAB"},
{"THURSDAY" ,"DC","OS","CN","OS"},
{"FRIDAY","CN","OS","WEBLAB","WEBLAB","WEBLAB"},
{ "SATURDAY","AJAVA","CN","AJAVALAB","AJAVALAB","AJAVALAB"} };
String column[]={"DAY","9- 10","10-11","11-12","12-1pm","1pm-2pm" };
final JTable jt=new JTable(data,column);
jt.setBounds(30,40,200,300);
f.add(jt);
f.setSize(600,600);
f.setVisible(true);
}
public static void main(String[] args) {
new Program3();
}
}