This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Get Programming with Java (MEAP only) and have Peggy Fisher on-line!
See this thread for details.
Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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
 
Never trust an airline that limits their passengers to one carry on iguana. Put this tiny ad in your shoe:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!