SLAZ IN

Greenhorn
+ Follow
since Oct 13, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by SLAZ IN

can i make a .bmp file or .ico file as my icon for frame?
How can i do that...
plz help...
15 years ago
Hi,
I am a beginner to JAVA. I have created a Jtable and added it to a JScrollpane. It is having 6 column headers.

I want to sort the contents of the table when we click on the column header.For that i want to know the event which is occurred on click.How can I know that on which column header the click is happened? What is the event that occurs on click on the column header?

The code written for creating the table is given below.

JTable mainTable = new JTable();
JScrollPane mainTableScrlPane = new JScrollPane();

DefaultTableModel mainTableModel = (new DefaultTableModel(new
Object [][] {}, new String [] {"Name","ID","Date","Time","Status","Physician"})
{
boolean[] canEdit = new boolean[]{false,false,false,false};
public boolean isCellEditable(int rowIndex,int colIndex)
{
return canEdit[colIndex];
}});

mainTable.setModel(mainTableModel);
mainTableScrlPane.getViewport().add(mainTable, null);

Please help me...
15 years ago