// 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. Java套接字Socket编程--TCP参数

    在Java的Socket中,主要包含了以下可设置的TCP参数. 属性 说明 默认值 SO_TIMEOUT 对ServerSocket来说表示等待连接的最长空等待时间; 对Socket来说表示读数据最长 ...

  2. JSch远程执行脚本

    JSch远程执行脚本 2017-02-24 在自动化测试的时候,需要远程操控服务器做一些操作,比如切日.起服务器.执行某些脚本.如何实现? 我们可以利用JSch,远程执行脚本.JSch是Java Se ...

  3. Lintcode: Subarray Sum 解题报告

    Subarray Sum 原题链接:http://lintcode.com/zh-cn/problem/subarray-sum/# Given an integer array, find a su ...

  4. Linux服务器集群系统(一)

    Reference: http://www.linuxvirtualserver.org/zh/lvs1.html LVS项目介绍 章文嵩 (wensong@linux-vs.org)2002 年 3 ...

  5. Android 异步任务——AsyncTask (附使用AsyncTask下载图片Demo)

    我们编程的时候经常需要处理同步任务和异步任务,在Android里面存在一个特性,就是UI线程是不安全的线程.所谓UI线程不安全也就是我们的主线程(进程启动的第一个线程)不能在线程外操作主线程的资源.因 ...

  6. Windows-DB2 9.7安装图解

    解压后,双击 setup.exe 安装 打开后,选择"安装产品" 在安装产品中,选择"安装新产品" 点击下一步 同意软件许可协议,点击下一步 可以根据需要,选择 ...

  7. C语言 · 集合运算

    算法训练 集合运算   时间限制:1.0s   内存限制:512.0MB    问题描述 给出两个整数集合A.B,求出他们的交集.并集以及B在A中的余集. 输入格式 第一行为一个整数n,表示集合A中的 ...

  8. UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)

    在使用selenium处理中文网页或者网页标题是中文的时候,出现UnicodeEncodeError: 'ascii' codec can't encode characters in positio ...

  9. python re 库的使用

    python re 库是关于正则表达式的一个库.这里面包含了多种字符串匹配的方法 使用例程 # -*- coding: utf-8 -*- import re # search 的作用是 查找后面字符 ...

  10. Scrum卡片层次图

    对照国内的项目管理软件禅道,可以好好感受一下,何为Scrum. 看板则一定要是实物,才有感觉.