When i create a JTable like the code shown below:
[B]String[] columnNames = {"First Name",
"Last Name",
"Sport",
"# of Years"};
Object[][] data = {
{"", "",
new Integer(5),""},
{"", "",
new Integer(5),""},
{"", "",
new Integer(5),""},
{"", "",
new Integer(5),""},
{"", "",
new Integer(5),""},
};
JTable table=new JTable(data,columnNames);
table.doLayout() ;[/B]
jp2.add(table);//where jp2 is a panel on a container on a frame
I dont get the Column names of the TABLE ..
The Table Screenshot i m presenting in the attachments
Please Help me with how to get Column names Displayed in the Table when the program is run
Attachments have screenshots of program when run..