图像滑块 [英] Image slider

查看:118
本文介绍了图像滑块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建类似这样的内容 http://flowplayer.org/tools/ demos / scrollable / index.html 但在Java Swing中。我不需要所有这些效果,只需滚动缩略图。很好的方法是使用工具栏和ImageIcons,然后点击一些JPanel上的加载图像。
这有什么常见做法吗?

I want to create something like this http://flowplayer.org/tools/demos/scrollable/index.html but in Java Swing. I dont need all those effects, just scrolling of thumbnail images. Is good aproach to use toolbar and ImageIcons, and then on click load image on some JPanel. Is there any common practice for this ?

推荐答案

对每个图像使用带有JLabel的GridLayout的JPanel。然后,您可以将面板添加到滚动窗格。您可以关闭滚动条,使其不可见。

Use a JPanel with a GridLayout containing a JLabel for each image. Then you can add the panel to a scrollpane. You can turn off the scrollbars so they are not visible.

然后您可以使用动作地图动作创建按钮进行滚动。

You can then use the technique described in Action Map Action to create buttons to do the scrolling.

这篇关于图像滑块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆