• 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 mechanism in JTable

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to override the behavior of the autoscroll function in JTable when extending the selection. Currently, it appears as though the autoscroller finds the cell in the table that would be under the mouse, and with each timer cycle, scrolls it to be visible. This gives nice dynamic scrolling speed, if your window is significantly smaller than the screen. However, if your window is maximized, scrolling moves very slowly. Users are complaining--our default table size is 1000 rows, and it takes forever to get through it.
I'm implementing autoscrolling for drag and drop as it's presented in Professional Java Programming. (WROX) I've modified it to be dynamic--it scrolls new rows and columns into view in increasingly larger blocks as the cursor gets closer to the edge of the table. This is done with the getScrollableUnitIncrement() method. It has the advantage of giving dynamic scrolling speed even when the window is maximized. I would like to get the same behavior out of the selection scrolling in the Table.
I had a look at BasicTableUI, and there are methods there for dealing with mouseDragging, and extending the selection. However, they refer to events generated by "the autoscroller" and I can't figure out where that code is.
Any suggestions would be welcome!
Thanks in Advance!
 
eric moon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I didn't need to deal with the autoscroller. I just disabled the drag-to-create-selection functionality in BasicTableUI and implemented it in my drag and drop.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic