dcsimg
How do I disable the reodering of table columns in a JTable but still allow sorting by clicking on Table Header?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, April 9, 2001 11:19 AM

I know that the method setReorderingAllowed(false) will stop the moving around of columns for my table, but why does my sort no longer work when this method is invoked?
For example, the following code stops working as soon as setReordingAllowed is set to false.

JTableHeader hdr = myTable.getTableHeader();

hdr.addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent e)
{
//table sort on this column
}
}

Re: How do I disable the reodering of table columns in a JTable but still allow sorting by clicking on Table Header?

Posted By:   Sandip_Chitale  
Posted On:   Monday, April 9, 2001 12:26 PM

It should work. I scanned the JDK source. I don't see anything suspicious.
Are you by any chance installing a different instance of the hdr somewher else. Does you mouse listener get called
at all ?
About | Sitemap | Contact