views:

359

answers:

1

On the iPhone scrolling through lists is animated smoothly. Ignoring the inertia effect (though having it would be cool as well) - how would I go about making a Swing listbox scroll smoothly like that?

There are other examples as well, like browsers, but those use native controls which I cannot use with Swing.

+3  A: 

If you are using JList try overwrite getScrollableUnitIncrement(Rectangle, int, int) and getScrollableBlockIncrement(Rectangle, int, int) to return custom increment .. e.g. 2 pixels instead of default values computed from list entry height.

Rastislav Komara