This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable : Setting Column Resize Off On MarginChanged Event

 
Kumar Srivatsa
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic