// 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的值的更多相关文章

  1. 设置select默认值

    W3C下设置一个默认值直接为 select.value='默认值'. IE8下设置默认值必须有这个option才能被设置,不像W3C 如chrome这种,直接设置就能显示,如果IE下这样设置的话sel ...

  2. 教你彻底解决css中设置z-index的值无效的问题

    在使用z-index这个属性之前,我们必须先了解使用z-index的必要条件: 1.要想给元素设置z-index样式,必须先让它变成定位元素,说的明白一点,就是要给元素设置一个postion:rela ...

  3. jquery设置checkbox状态,设置dropdownlist选中值,隐藏某控件,给某控件追加东西

    jquery设置checkbox状态 $("[ID$=chkType]").attr("checked", true); jquery设置dropdownlis ...

  4. 为何在font-family属性中设置多个值

    通常前端开发中会对body标签中设置font-family属性多个值,例如: body{padding:0;margin:0;font-size:12px;text-align:left;font-f ...

  5. CheckBoxList 获取与设置选中的值

    /// <summary> ///CheckBoxListHelper 的摘要说明 ///CheckBoxList获取与设置选中的值 /// </summary> public ...

  6. Django forms 关于select和checkbox设置初始选中值及让前端选中指定值

    Django的forms和models一样很牛逼.他有两种功能,一是生成form表单,还有就是form表单的验证. 这里主要说一下生成form表单时经常用到的需要设置 初始值 / 默认值 的情况. 1 ...

  7. IE中float元素如果同时设置了margin值,此时margin的值会变为双倍的解决方法

    IE中float元素如果同时设置了margin值,此时margin的值会变为双倍, 解决办法: 是在该元素中加入display:inline.

  8. Mysql 数据库date, datetime类型设置0000-00-00默认值(default)报错问题

    Mysql 数据库date, datetime类型设置0000-00-00默认值报错问题 现象:MySQL5.7版本之后,date, datetime类型设置默认值"0000-00-00&q ...

  9. select设置text的值选中(兼容ios和Android)基于jquery

    前一段时间改了一个bug,是因为select引起的.当时我没有仔细看,只是把bug改完了就完事了,今天来总结一下. 首先说option中我们通常会设置value的属性的,还有就是text值的,请参见下 ...

随机推荐

  1. nginx配置长连接

    http { keepalive_timeout 20; --长连接timeout keepalive_requests 8192; --每个连接最大请求数 } events { worker_con ...

  2. 双重检验的单例模式,为什么要用volatile关键字

    双重检验的单例模式是比较推荐的单例写法,在该代码中的单例对象的是用volatile关键字修饰的.这时就产生的一个疑问,为什么需要volatile来修饰呢?上网查看多个博客,下面简单通俗分析一下当中的原 ...

  3. 使用jquery提交FormData数据

    https://blog.csdn.net/u011500781/article/details/54931716 http://yunzhu.iteye.com/blog/2177923 ***** ...

  4. flash object实现视频播放效果

    html: <!--视频缩略图开始-->       <div class="fresh-media fresh-type-video">          ...

  5. 【神经网络】BP反向传播神经网络

    BP算法细节 参数说明:假设有n层.J表示代价函数,和上面的E是同样的意思,只不过用不同的字母写而已. 分析:要想知道第l层的第i个结点的残差,必须知道层已经计算出来了残差,你只要把后面一层的每个结点 ...

  6. maven pom scope 含义

    maven pom scope 依赖范围控制哪些依赖在哪些classpath 中可用,哪些依赖包含在一个应用中.让我们详细看一下每一种范围: compile (编译范围) compile是默认的范围: ...

  7. AAPT err(Facade for): libpng error: Not a PNG file 错误解决

    在导入项目到Android studio后,若编译出现“AAPT err(Facade for): libpng error: Not a PNG file”错误. 该错误表示项目中的drawable ...

  8. LR中,URL -based script与HTML -based script区别

    在Web(HTTP/HTML)录制中,有2种重要的录制模式.用户该选择那种录制模式呢?HTML-mode录制是缺省也是推荐的录制模式.它录制当前网页中的HTML动作.在录制会话过程中不会录制所有的资源 ...

  9. Jquery的回调函数的使用

    用$.Callbacks实现观察者模式 // 观察者模式 var observer = { hash: {}, subscribe: function(id, callback) { if (type ...

  10. 【微信小程序】使用setTimeout制作定时器的思路

    setTimeout(func, time)可以使得每隔time毫秒就执行一次func函数,常用来做计时器/时钟. 下面是在微信小程序中的使用思路,只截取了关键部分代码. var timer; // ...