Some kind of image list thing

It’s swing so if you don’t use it you’re probably not interested.

Anyway, this is just a preconfigured horizontal JList with some hacks to make tooltips less painful.
It is somewhat similar to the gnome image list (one example of which appears in the choose background image app), but they are still slightly better in that (intuitively) the left and right arrows transpose the selection to the upper and lower row when at the edges of a line. If you could point me out a way to do that i’d appreciate it.
I would put in the code here but it exceeds 10000 characters (just so you see how much code is required to bend swing into forms that were never meant to be).

http://code.google.com/p/bookjar-utils/source/browse/BookJar-utils/src/util/swing/components/ImageList.java

Thanks for sharing.

It is less flexible than is probably useful to other people though. My approach of fixing the renderer and only abstracting a listener for the values, while it made things easy for making the look i was trying for and clean code (why i wrap the JList instead of extending and only expose the methods i need, seperate from the view), it also made that look boring. The default UI colors, a image above label cellrenderer and a half-baked cache and some thread safety assurances for it (i am up to my neck in threads to make the secondary disc cache anyway).

thanks

I wanted to ask: anyone knows of a way to make a Jlist like this, that has multiple cells in both rows and columns, allow for different keyboard movement with the arrow keys? Instead of only using ↑ and ↓ to move up and down also allow ← and → if the selected cell mets the west or east edges of the viewport?

I did it. It was just getting the old action with the arrow keycodes from the old inputmap and actionmap, saving it has a parameter for the new action if they aren’t on the edge of the row and detecting the edge and move up or down.

It’s ok i think - only problem should occur if some platform doesn’t use the arrow keys (the is no left movement key or something abstract like that).