⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 doubleheadedscrollbar.java

📁 一本有关Java图形界面设计的一本书,英文的,附带有源码,
💻 JAVA
字号:
import javax.swing.JScrollBar;
import javax.swing.plaf.ScrollBarUI;

/**
 * DoubleHeadedScrollbar is a scrollbar with one additional feature:
 * you can resize the thumb using draggable buttons at each end of it.
 * For simplicity, this DoubleHeadedScrollbar can only be horizontal
 * (those this can easily be fixed with a little more coding).
 */
public class DoubleHeadedScrollbar extends JScrollBar {

    /**
     * Make a horizontal DoubleHeadedScrollbar.
     * @param value initial value
     * @param extent size of visible area (thumb size)
     * @param min minimum value
     * @param max maximum value 
     */
    public DoubleHeadedScrollbar(int value, int extent, int min, int max) {
        super(HORIZONTAL, value, extent, min, max);
    }
    
    // override setUI() to always use our own look-and-feel.
    public void setUI(ScrollBarUI ui) {
        super.setUI(new DoubleHeadedScrollbarUI());
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -