Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Autoscroll JTable in JScrollPane  RSS feed

 
Steffen Foldager
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Y'all
I have a JTable within a JScrollPane. I want to do drag&drop within the table (move rows around). The table is usually longer than the scrollpane, and I want to autoscroll the table within the scrollpane.
I have implemented java.awt.dnd.Autoscroll in the JTable, but the
public void autoscroll(Point cursorLocn)
method is only called when the cursor is at the "absolute" edges of the JTable. I want this method to be called when the cursor is at the visible edges of the table (or else autoscroll doesn't make much sense ?)
I have also tried letting the JScrollPane implement AutoScroll without any luck.
Does anyone have experience in this area?
Rgds,
Steffen
 
Steffen Foldager
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Steffen
I just found a solution by Dave Ortman from comp.lang.java.gui here
It works great! See you around
/Steffen
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!