e795. 获得和设置JSlider的值
// To create a slider, see e794 创建JSlider组件 // Get the current value
int value = slider.getValue(); // Get the minimum value
int min = slider.getMinimum(); // Get the maximum value
int max = slider.getMaximum(); // Get the extent
int extent = slider.getExtent();
// Change the minimum value
int newMin = 0;
slider.setMinimum(newMin); // Change the maximum value
int newMax = 256;
slider.setMaximum(newMax); // Set the value; the new value will be forced into the bar's range
int newValue = 33;
slider.setValue(newValue); // Set the extent
int newExtent = 10;
slider.setExtent(newExtent);
It is also possible to set all the values at once by using the model:
slider.getModel().setRangeProperties(newValue, newExtent, newMin, newMax, false);
| Related Examples |
e795. 获得和设置JSlider的值的更多相关文章
- 设置select默认值
W3C下设置一个默认值直接为 select.value='默认值'. IE8下设置默认值必须有这个option才能被设置,不像W3C 如chrome这种,直接设置就能显示,如果IE下这样设置的话sel ...
- 教你彻底解决css中设置z-index的值无效的问题
在使用z-index这个属性之前,我们必须先了解使用z-index的必要条件: 1.要想给元素设置z-index样式,必须先让它变成定位元素,说的明白一点,就是要给元素设置一个postion:rela ...
- jquery设置checkbox状态,设置dropdownlist选中值,隐藏某控件,给某控件追加东西
jquery设置checkbox状态 $("[ID$=chkType]").attr("checked", true); jquery设置dropdownlis ...
- 为何在font-family属性中设置多个值
通常前端开发中会对body标签中设置font-family属性多个值,例如: body{padding:0;margin:0;font-size:12px;text-align:left;font-f ...
- CheckBoxList 获取与设置选中的值
/// <summary> ///CheckBoxListHelper 的摘要说明 ///CheckBoxList获取与设置选中的值 /// </summary> public ...
- Django forms 关于select和checkbox设置初始选中值及让前端选中指定值
Django的forms和models一样很牛逼.他有两种功能,一是生成form表单,还有就是form表单的验证. 这里主要说一下生成form表单时经常用到的需要设置 初始值 / 默认值 的情况. 1 ...
- IE中float元素如果同时设置了margin值,此时margin的值会变为双倍的解决方法
IE中float元素如果同时设置了margin值,此时margin的值会变为双倍, 解决办法: 是在该元素中加入display:inline.
- Mysql 数据库date, datetime类型设置0000-00-00默认值(default)报错问题
Mysql 数据库date, datetime类型设置0000-00-00默认值报错问题 现象:MySQL5.7版本之后,date, datetime类型设置默认值"0000-00-00&q ...
- select设置text的值选中(兼容ios和Android)基于jquery
前一段时间改了一个bug,是因为select引起的.当时我没有仔细看,只是把bug改完了就完事了,今天来总结一下. 首先说option中我们通常会设置value的属性的,还有就是text值的,请参见下 ...
随机推荐
- 4.3之后的PingPong效果实现
旧版本的Unity提供Animation编辑器来编辑物理动画. 在其下方可以设置动画是Loop或者是Pingpong等运动效果. 但是,在4.3之后,Unity的动画系统发生了较大的变化. 相信很多童 ...
- Spark orderBy(desc("col"))部分数据排序失败
起因 对数据进行三个维度的排序,用的是orderBy(desc("col")),结果其中两个维度上结果返回正确,另外一个维度上结果出现了大的排在后面的结果,错误的结果大概如下: w ...
- 组策略分发Adobe Reader 11教程
1, 实验环境 域控:Windows Server 2012 R2 客户端:Windows 7 Adobe Reader 版本:11.0.00 2, 获取分发 Adobe Reader 的许可协议 按 ...
- Airlaunch 快捷设置代码分享
Airlaunch 快捷设置代码分享设置:prefs:root=SETTING蜂窝网络:prefs:root=MOBILE_DATA_SETTINGS_IDWIFI:prefs:root=WIFI定位 ...
- Python(四)之Python流程控制(if、while、for)
Python流程控制 if测试: if 条件测试表达式: 组合条件测试: x and y:与运算 x or y:或运算 not x:非运算 while: break:跳出最内层的循环 continue ...
- jetty 7.0 笔记
codehaus download:http://dist.codehaus.org/jetty/ 找到7.0 tar.gz 解压 拉取 Lib下jar 和 Lib--jsp下jar 代码同启动 ...
- 新的开始——LED灯汇编机器码的点亮方式
在几个月前看2440视频的时候,发现太多知识欠缺,购买开发板期间补习makefile,linux,arm汇编和arm构架之后,现在重新开始学习. 先看板子LED硬件连接图: 可以看到LED 1,2,4 ...
- 2017 年 机器学习之数据挖据、数据分析,可视化,ML,DL,NLP等知识记录和总结
今天是2017年12月30日,2017年的年尾,2018年马上就要到了,回顾2017过的确实很快,不知不觉就到年末了,再次开篇对2016.2017年的学习数据挖掘,机器学习方面的知识做一个总结,对自己 ...
- spring security 注解@EnableGlobalMethodSecurity详解
1.Spring Security默认是禁用注解的,要想开启注解,需要在继承WebSecurityConfigurerAdapter的类上加@EnableGlobalMethodSecurity注解 ...
- for语句查看js对象
for (var obj in o.curform) { document.write("<p>" + obj + " = " + o.curfor ...