Java 8 Scrollbar - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Scrollbar class.

This code example shows how to use the following methods:getPreferredSize, setBounds, getValue, setValues
// with additional replacement of deprecated methods 
    public void setBounds(int x, int y, int w, int h) {
 
        super.setBounds(x, y, w, h);
 
        iSbHeight = sbHoriz.getPreferredSize().height;
        iSbWidth  = sbVert.getPreferredSize().width;
        iHeight   = h - iSbHeight;
        iWidth    = w - iSbWidth;
 
        sbHoriz.setBounds(0, iHeight, iWidth, iSbHeight);
        sbVert.setBounds(iWidth, 0, iSbWidth, iHeight);
        adjustScroll(); 
 
        iImage = null;
 
        repaint();
    } 
 
    /** 

6
CodeRank
This code example shows how to use the following methods:setMaximum, setVisibleAmount
                             ourDim.height - botDim.height ) ;
 
       Dimension dim = c.getSize() ;
 
       int vis = ourDim.height ;
       _right.setVisibleAmount( vis ) ;
       _right.setMaximum( dim.height - vis ) ;
       System.out.println( " dim : "+vis+ "  "+dim.width ) ;
 
    } 
 
    public void setTree( TreeNodeable node ){
        _tree.setTree( node ) ;
    } 
    @Override 
    public Dimension getPreferredSize(){ return new Dimension(300,300) ; }
    @Override 
    public Dimension getSize(){ return getPreferredSize() ; }
    // 
    // our layout manager 
4
CodeRank
This code example shows how to use the following methods:getBlockIncrement, getMaximum, getMinimum, getOrientation, getUnitIncrement
    // 
    // Construction 
    // 
 
    public SwingScrollbarPeer(SwingToolkit toolkit, Scrollbar sb) {
        super(toolkit, sb, new SwingScrollbar(sb));
        SwingToolkit.add(sb, peerComponent);
        SwingToolkit.copyAwtProperties(sb, peerComponent);
        final SwingScrollbar jsb = (SwingScrollbar) peerComponent;
        jsb.setOrientation(sb.getOrientation());
        jsb.setBlockIncrement(sb.getBlockIncrement());
        jsb.setUnitIncrement(sb.getUnitIncrement());
        setValues(sb.getValue(), sb.getVisibleAmount(), sb.getMinimum(), sb
            .getMaximum());
    } 
 
    /** 
     * @see java.awt.peer.ScrollbarPeer#setLineIncrement(int) 
     */ 
    public void setLineIncrement(int inc) {
4
CodeRank
This code example shows how to use the following methods:getValue
            case Event.SCROLL_LINE_UP :
            case Event.SCROLL_LINE_DOWN :
            case Event.SCROLL_PAGE_UP :
            case Event.SCROLL_PAGE_DOWN :
            case Event.SCROLL_ABSOLUTE :
                iX = sbHoriz.getValue();
                iY = iRowHeight * sbVert.getValue();
 
                repaint();
 
                return true; 
        } 
 
        return super.handleEvent(e);
    } 
 
    /** 
     * Method declaration 
     * 
     * 
4
CodeRank
This code example shows how to use the following methods:getValue
		close(); 
		Prefs.saveLocation(LOC_KEY, getLocation());
	} 
 
	public void adjustmentValueChanged(AdjustmentEvent e) {
		if (e.getSource().equals(slider)) {
			rotateTo(slider.getValue() * Math.PI / 180);
			updateTextbox(); 
		} 
	} 
 
	public void itemStateChanged(ItemEvent e) {
		Object source = e.getSource();
		if (source.equals(axis0Choice)) {
			int i = axis0Choice.getSelectedIndex();
			if (i == axis1Choice.getSelectedIndex()) {
				axis0Choice.select(axis0);
				IJ.error("Both axes cannot indicate the same direction"); 
				return; 
			} 
3
CodeRank
See Code Examples for Java 8 Scrollbar Methods: