当前位置: 首页>>代码示例>>Java>>正文


Java JScrollBar.VERTICAL属性代码示例

本文整理汇总了Java中javax.swing.JScrollBar.VERTICAL属性的典型用法代码示例。如果您正苦于以下问题:Java JScrollBar.VERTICAL属性的具体用法?Java JScrollBar.VERTICAL怎么用?Java JScrollBar.VERTICAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.swing.JScrollBar的用法示例。


在下文中一共展示了JScrollBar.VERTICAL属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPreferredSize

public Dimension getPreferredSize(JComponent c) {
    Insets insets = c.getInsets();
    int dx = insets.left + insets.right;
    int dy = insets.top + insets.bottom;
    return (scrollbar.getOrientation() == JScrollBar.VERTICAL)
        ? new Dimension(dx + 11, dy + 33)
        : new Dimension(dx + 33, dy + 11);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:MotifScrollBarUI.java

示例2: getPreferredSize

public Dimension getPreferredSize( JComponent c )
{
    if ( scrollbar.getOrientation() == JScrollBar.VERTICAL )
    {
        return new Dimension( scrollBarWidth, scrollBarWidth * 3 + 10 );
    }
    else  // Horizontal
    {
        return new Dimension( scrollBarWidth * 3 + 10, scrollBarWidth );
    }

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:MetalScrollBarUI.java

示例3: initComponents

private void initComponents() {        
    table = new DetailsTable();
    table.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    JViewport viewport = new Viewport(table);

    final JScrollPane tableScroll = new JScrollPane(
                                        JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                                        JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    tableScroll.setViewport(viewport);
    tableScroll.setBorder(BorderFactory.createEmptyBorder());
    tableScroll.setViewportBorder(BorderFactory.createEmptyBorder());
    tableScroll.setCorner(JScrollPane.UPPER_RIGHT_CORNER, new HeaderPanel());
    
    scrollBar = new ScrollBar(JScrollBar.VERTICAL) {
        public int getUnitIncrement(int direction) {
            JViewport vp = tableScroll.getViewport();
            Scrollable view = (Scrollable)(vp.getView());
            Rectangle vr = vp.getViewRect();
            return view.getScrollableUnitIncrement(vr, getOrientation(), direction);
        }
        public int getBlockIncrement(int direction) {
            JViewport vp = tableScroll.getViewport();
            Scrollable view = (Scrollable)(vp.getView());
            Rectangle vr = vp.getViewRect();
            return view.getScrollableBlockIncrement(vr, getOrientation(), direction);
        }
        public void setValues(int newValue, int newExtent, int newMin, int newMax) {
            setEnabled(newExtent < newMax);
            if (isEnabled() && !isSelectionChanging() && isTrackingEnd())
                newValue = newMax - newExtent;
            super.setValues(newValue, newExtent, newMin, newMax);
        }
    };
    tableScroll.setVerticalScrollBar(scrollBar);
    dataContainer = tableScroll;

    JLabel noDataLabel = new JLabel("<No probe selected>", JLabel.CENTER);
    noDataLabel.setEnabled(false);
    noDataContainer = new JPanel(new BorderLayout());
    noDataContainer.setOpaque(false);
    noDataContainer.add(noDataLabel, BorderLayout.CENTER);

    setOpaque(false);
    setLayout(new BorderLayout());
    add(noDataContainer, BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:47,代码来源:DetailsPanel.java

示例4: paintThumb

protected void paintThumb( Graphics g, JComponent c, Rectangle thumbBounds )
{
    if (!c.isEnabled()) {
        return;
    }

    if (MetalLookAndFeel.usingOcean()) {
        oceanPaintThumb(g, c, thumbBounds);
        return;
    }

    boolean leftToRight = MetalUtils.isLeftToRight(c);

    g.translate( thumbBounds.x, thumbBounds.y );

    if ( scrollbar.getOrientation() == JScrollBar.VERTICAL )
    {
        if ( !isFreeStanding ) {
            thumbBounds.width += 2;
            if ( !leftToRight ) {
                g.translate( -1, 0 );
            }
        }

        g.setColor( thumbColor );
        g.fillRect( 0, 0, thumbBounds.width - 2, thumbBounds.height - 1 );

        g.setColor( thumbShadow );
        drawRect(g, 0, 0, thumbBounds.width - 2, thumbBounds.height - 1);

        g.setColor( thumbHighlightColor );
        drawHLine(g, 1, thumbBounds.width - 3, 1);
        drawVLine(g, 1, 1, thumbBounds.height - 2);

        bumps.setBumpArea( thumbBounds.width - 6, thumbBounds.height - 7 );
        bumps.paintIcon( c, g, 3, 4 );

        if ( !isFreeStanding ) {
            thumbBounds.width -= 2;
            if ( !leftToRight ) {
                g.translate( 1, 0 );
            }
        }
    }
    else  // HORIZONTAL
    {
        if ( !isFreeStanding ) {
            thumbBounds.height += 2;
        }

        g.setColor( thumbColor );
        g.fillRect( 0, 0, thumbBounds.width - 1, thumbBounds.height - 2 );

        g.setColor( thumbShadow );
        drawRect(g, 0, 0, thumbBounds.width - 1, thumbBounds.height - 2);

        g.setColor( thumbHighlightColor );
        drawHLine(g, 1, thumbBounds.width - 3, 1);
        drawVLine(g, 1, 1, thumbBounds.height - 3);

        bumps.setBumpArea( thumbBounds.width - 7, thumbBounds.height - 6 );
        bumps.paintIcon( c, g, 4, 3 );

        if ( !isFreeStanding ) {
            thumbBounds.height -= 2;
        }
    }

    g.translate( -thumbBounds.x, -thumbBounds.y );
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:70,代码来源:MetalScrollBarUI.java

示例5: createVerticalScrollBar

@Override
public JScrollBar createVerticalScrollBar() {
    return new XAWTScrollBar(JScrollBar.VERTICAL);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:XTextAreaPeer.java


注:本文中的javax.swing.JScrollBar.VERTICAL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。