File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JTable : Setting Column Resize Off On MarginChanged Event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable : Setting Column Resize Off On MarginChanged Event" Watch "JTable : Setting Column Resize Off On MarginChanged Event" New topic
Author

JTable : Setting Column Resize Off On MarginChanged Event

Kumar Srivatsa
Greenhorn

Joined: Jun 04, 2009
Posts: 2
Hello Everyone,

I am trying to set column resizing off on a table when someone drags a column in a Jtable.

I made a small modification to the SimpleTableDemo that turns the column resizing on the table off when a column is physically dragged. I added a column model listener and turn the column resizing off on the columnMarginChanged event (Lines 59 - 60)





The issue here is that the table columns seem to stutter and not properly resize when the column is dragged. Eventually once the scrollbar comes in and the mouse is released the column resizing seems to turn off and columns are resized.

Any ideas as to what is going on here ??


Thanks,
Kumar
Kumar Srivatsa
Greenhorn

Joined: Jun 04, 2009
Posts: 2
Problem solved. I realized what I was doing wrong here .

The JTable resizes the columns to defaults when the AUTO_RESIZE_OFF is invoked.. at the same time a drag action by the user caused the stuttering behavior.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable : Setting Column Resize Off On MarginChanged Event
 
Similar Threads
JTable is not inserting the data
Boolean Question in SimpleTableDemo.java Sun sample prog
JTable inside JScrollPane - background coloring problem
how to execute simple swing program
Understanding JTable.addColumn()