// 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. adb devices连接提示 Android offline或unauthorized的解决办法

    我有一个华为X1手机,版本是Android 4.2.2(我的手机是Android 4.0版本), 但之前用adb连接(包括usb/tcp)时总莫名其妙出现offline或unauthorized的问题 ...

  2. [Windows Azure] Guidelines for Connecting to Windows Azure SQL Database

    Guidelines for Connecting to Windows Azure SQL Database 6 out of 12 rated this helpful - Rate this t ...

  3. cocoside 编译错误可能问题

    版本不对..查看/usr/xxx/.profile中console等的全局变量 安装了不和谐的版本..记得删除application/cosos 重新安装. 或者干掉cocostudio

  4. DIOCP开源项目-DIOCP3直接发送对象,帮你处理粘包问题

    该DEMO演示,如何在客户端与服务端之间直接传递TStream对象,让你专注于处理数据逻辑,可以忽略处理网络传输间粘包的问题. 上面由服务端向所有的客户端推送一个消息TMemoryStream对象(该 ...

  5. 【内核】内核链表使用说明,list.h注释

    list_entry定义 /** * list_entry - get the struct for this entry * @ptr: the &struct list_head poin ...

  6. Asp.Net正则过滤一个div

    Asp.Net过滤一对标签,例如div.ul.p.li.span等 html = “html page”; Regex regPage = new Regex(@"(?is)<div\ ...

  7. MySQL查看当前运行的事务和执行的账户

    -- 查看当前运行的事务,这点在变更表结构之前必须要查看select * from information_schema.innodb_trx; -- 查看当前运行的事务的账户和事务开始的时间,及其事 ...

  8. 使用卷积神经网络CNN训练识别mnist

    算的的上是自己搭建的第一个卷积神经网络.网络结构比较简单. 输入为单通道的mnist数据集.它是一张28*28,包含784个特征值的图片 我们第一层输入,使用5*5的卷积核进行卷积,输出32张特征图, ...

  9. zmap blacklist

    # From IANA IPv4 Special-Purpose Address Registry# http://www.iana.org/assignments/iana-ipv4-special ...

  10. vpnbook.py

    vpnbook提供免费的vpn服务,当然了,免费的肯定有限制,vpnbook的限制在于速度,一般只有10kb/s左右,用来看看网页还可以,当主力就不够了. 话说IE存在的意义就是用来下载其它浏览器,我 ...