zoukankan      html  css  js  c++  java
  • e794. 创建JSlider组件

    // Create a horizontal slider with min=0, max=100, value=50
        JSlider slider = new JSlider();
        
        // Create a horizontal slider with custom min and max; value is set to the middle
        int minimum = -255;
        int maximum = 256;
        slider = new JSlider(minimum, maximum);
        
        // Create a horizontal slider with custom min, max, and value
        int initValue = 0;
        slider = new JSlider(minimum, maximum, initValue);
        
        // Create a vertical slider with min=0, max=100, value=50
        slider = new JSlider(JSlider.VERTICAL);
        
        // Create a vertical slider with custom min, max, and value
        slider = new JSlider(JSlider.VERTICAL, minimum, maximum, initValue);
    

    In addition to allowing the user to drag the slider, some look and feels allow the user page the slider by a fixed amount. This amount is called the extent.

        // Set an extent
        int extent = 10;
        slider.setExtent(extent);
    

    For most look and feels, the slider appears as a knob on a track. In this case, it is possible to hide the track:

        slider.setPaintTrack(false);
    
    Related Examples
  • 相关阅读:
    xss攻击和csrf攻击的定义及区别
    php中Redis的扩展
    MySQL事务特性
    PHP的设计模式
    http协议
    sql语句的优化
    mysql存储引擎
    laravel框架安装Curl扩展
    laravel框架中安装 elasticsearch 包
    docker容器配置nginx负载均衡 -----加权
  • 原文地址:https://www.cnblogs.com/borter/p/9596224.html
Copyright © 2011-2022 走看看