问题描述
我正在创建一个IMDB应用程序,用于显示和组织在您的计算机上找到的电影(通过IMDB API查找元数据).
I am creating an IMDB application which displays and organizes movies found on you computer (by looking up the metadata via an IMDB API).
在搜索面板中,我希望为用户提供查找特定年份(例如1990年至2005年)发行的电影的选项.目前,我使用这两个JSpinner,一个用于最小年份,一个用于最大年份,并使用交叉验证来检查是否maxYear >= minYear && minYear <= maxYear
,但是我认为这不是非常用户友好.
In my search panel I want to give the user the option of looking for movies that were released in a specific range of years (e.g. between 1990 and 2005). Currently I use for this two JSpinners, one for the minimum year and one for the maximum year and use cross validation to check whether maxYear >= minYear && minYear <= maxYear
However I don't think this is very user-friendly.
我想要的是一个带有两个旋钮的JSlider,一个用于最小,一个用于最大.这可能吗?您是否还有其他想法可以使该界面更加人性化?
What I would like is a JSlider with two knobs, one for min and one for max. Is this possible? Do you have any other ideas on how to make this interface more user-friendly?
推荐答案
这看起来很有希望:创建Java Swing范围滑块
这是另一个我认为来自旧Tame示例的示例: MThumbSlider
And here's another example that I think came from the old Tame examples: MThumbSlider
这篇关于如何在Java GUI中指定有效值范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!