• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Autoscroll JTable in JScrollPane

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic