How to display a gallery of small picture icons in a Left-Right-Horizontal navigatable style, like in JavaScript/ JQuery

别等时光非礼了梦想. 提交于 2020-01-16 01:05:25

问题


This is usually done in JavaScript/ JQuery. I'd like an implementation in Java/ JavaFx.

A bit more details:

I have a gallery of pictures I'd like to list, first as small 32 * 32, then when a user clicks on one of the 32 * 32 icons, a larger one of the clicked should appear on another pane.

The problem I have is listing them horizontally so that a user could use Left-Right navigation arrows on either edge to show other new pictures not yet in view (more 32 by 32 picture icons become visible as others slide out of view either to the Left or Right), so I don't think that TableView's the best way to go.

I'd like something like this:

Please help me on how I could implement this? Thank you in advance....


回答1:


Take a look at the DisplayShelf example from the Java 8 Ensemble 8 sample application.

The sample is more complex than what you need, but you could probably learn from it, simplify it and adapt it for your work.

The Ensemble 8 application is in the Java 8 Demos and Samples download for Java 8, so you can easily download and run it (use java -jar Ensemble8.jar) out of the demo/javafx_samples directory. Then search for DisplayShelf from within the Ensemble 8 application.



来源:https://stackoverflow.com/questions/22708506/how-to-display-a-gallery-of-small-picture-icons-in-a-left-right-horizontal-navig

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!