views:

211

answers:

2

I've implemented drag scroll before, but what's the best way to go about creating an infinite scroll pane? Of course there won't be any scrollbars and I will implement drag scroll.

What I am trying to do is implement dynamic loading on an infinite surface.

EDIT

Of course it wouldn't actually be infinite. I am asking how to fake it.

A: 

Sounds like you might have to make your own scroll bar control that gives the illusion your after.

Sir Psycho
Well that's pretty much what the question is about.
OscarRyz
Wow, Oscar is downvote happy.
Ed Swangren
+1  A: 

You could use JScrollPane.getViewport() to get the JViewport and add a ChangeListener to it. The JViewport will alert your listener when the size or, more importantly the position has changed. If the position has changed close to the edge of the JScrollPane you can then resize the viewport (you will need to disregard the size-triggered change event).

akf