在 Swing 中叠加多个 JSlider [英] Overlay multiple JSliders in Swing

查看:23
本文介绍了在 Swing 中叠加多个 JSlider的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以覆盖多个 JSlider,以便我可以看到两者上的拇指"(我尝试禁用轨道的绘制并将不透明度设置为 false,但一个仍然隐藏另一个)?基本上我想创建一个允许用户定义范围的组件(我真的不想写一个自定义的,因为它具有滑块的大部分属性).如果有另一种方法可以用滑块来做到这一点,那也行.

Is it possible to overlay multiple JSliders so I can see the "thumbs" on both (I've tried disabling the painting of the track and setting opacity to false but one still hides the other)? Basically I'd like to create a component that allows the user to define a range (and I didn't really want to write a custom one since it has most of the attributes of a slider). If there is another way I could do that with a slider, that would work too.

谢谢,

杰夫

推荐答案

啊,我找到了(我一定没有按照正确的条件进行搜索).Swing 实验室作为 JXMultiThumbSlider,我认为可以解决问题.

Ah, I found it (i must not have been seraching on the right terms). Swing labs as a JXMultiThumbSlider that I think will do the trick.

http://swinglabs.org/hudson/job/SwingX%20Weekly%20Build/javadoc/org/jdesktop/swingx/JXMultiThumbSlider.html

这篇关于在 Swing 中叠加多个 JSlider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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