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
  • 相关阅读:
    莫队专题
    AJAX XML 实例
    AJAX 简介
    AJAX 服务器响应
    AJAX 创建XMLHttpRequest 对象
    AJAX 教程
    AJAX 向服务器发送请求
    AJAX onreadystatechange 事件
    AJAX ASP/PHP 请求实例
    让卖场的死角“起死回生”
  • 原文地址:https://www.cnblogs.com/borter/p/9596224.html
Copyright © 2011-2022 走看看