This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Autoscroll JTable in JScrollPane  RSS feed

 
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!