Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (801)
Games in Android Showcase (237)
games submitted by our members
Games in WIP (867)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Some kind of image list thing  (Read 4218 times)
0 Members and 1 Guest are viewing this topic.
Offline i30817

Junior Devvie

« Posted 2010-11-30 12:14:42 »

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).
Offline gouessej
« Reply #1 - Posted 2010-11-30 15:39:09 »

Thanks for sharing.

Julien Gouesse | Personal blog | Website | Jogamp
Offline i30817

Junior Devvie

« Reply #2 - Posted 2010-11-30 16:23:14 »

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).
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SwampChicken
« Reply #3 - Posted 2010-12-01 07:32:48 »

Offline i30817

Junior Devvie

« Reply #4 - Posted 2011-05-28 05:34:09 »

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?
Offline i30817

Junior Devvie

« Reply #5 - Posted 2011-06-11 08:07:39 »

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).
Pages: [1]
  ignore  |  Print  

Riven (353 views)
2019-09-04 15:33:17

hadezbladez (5191 views)
2018-11-16 13:46:03

hadezbladez (2076 views)
2018-11-16 13:41:33

hadezbladez (5413 views)
2018-11-16 13:35:35

hadezbladez (1128 views)
2018-11-16 13:32:03

EgonOlsen (4550 views)
2018-06-10 19:43:48

EgonOlsen (5413 views)
2018-06-10 19:43:44

EgonOlsen (3090 views)
2018-06-10 19:43:20

DesertCoockie (3986 views)
2018-05-13 18:23:11

nelsongames (4590 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!