當前位置: 首頁>>代碼示例>>Java>>正文


Java JScrollPane.getVerticalScrollBar方法代碼示例

本文整理匯總了Java中javax.swing.JScrollPane.getVerticalScrollBar方法的典型用法代碼示例。如果您正苦於以下問題:Java JScrollPane.getVerticalScrollBar方法的具體用法?Java JScrollPane.getVerticalScrollBar怎麽用?Java JScrollPane.getVerticalScrollBar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JScrollPane的用法示例。


在下文中一共展示了JScrollPane.getVerticalScrollBar方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: componentMoved

import javax.swing.JScrollPane; //導入方法依賴的package包/類
@Override
      public void componentMoved(ComponentEvent e) {
   if(timer == null) {
JScrollPane   scrollPane = getScrollPane();

if(scrollPane == null) {
    change();
              } else {
    scrollBar = scrollPane.getVerticalScrollBar();
    if(scrollBar == null || 
	!scrollBar.getValueIsAdjusting()) {
	// Try the horizontal scrollbar.
	if((scrollBar = scrollPane.getHorizontalScrollBar())
	    != null && scrollBar.getValueIsAdjusting()) {
                              
	    startTimer();
                      } else {
	    change();
                      }
    } else {
	startTimer();
                  }
}
   }
      }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:26,代碼來源:Outline.java

示例2: func_164247_a

import javax.swing.JScrollPane; //導入方法依賴的package包/類
public void func_164247_a(final JTextArea p_164247_1_, final JScrollPane p_164247_2_, final String p_164247_3_)
{
    if (!SwingUtilities.isEventDispatchThread())
    {
        SwingUtilities.invokeLater(new Runnable()
        {
            public void run()
            {
                MinecraftServerGui.this.func_164247_a(p_164247_1_, p_164247_2_, p_164247_3_);
            }
        });
    }
    else
    {
        Document document = p_164247_1_.getDocument();
        JScrollBar jscrollbar = p_164247_2_.getVerticalScrollBar();
        boolean flag = false;

        if (p_164247_2_.getViewport().getView() == p_164247_1_)
        {
            flag = (double)jscrollbar.getValue() + jscrollbar.getSize().getHeight() + (double)(serverGuiFont.getSize() * 4) > (double)jscrollbar.getMaximum();
        }

        try
        {
            document.insertString(document.getLength(), p_164247_3_, (AttributeSet)null);
        }
        catch (BadLocationException var8)
        {
            ;
        }

        if (flag)
        {
            jscrollbar.setValue(Integer.MAX_VALUE);
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:39,代碼來源:MinecraftServerGui.java

示例3: scrollToTop

import javax.swing.JScrollPane; //導入方法依賴的package包/類
/**
 * Scrolls scroll pane to the top left corner.
 */
public static void scrollToTop(final JScrollPane scrollPane) {
	JScrollBar verticalScrollBar = scrollPane.getVerticalScrollBar();
	JScrollBar horizontalScrollBar = scrollPane.getHorizontalScrollBar();
	verticalScrollBar.setValue(verticalScrollBar.getMinimum());
	horizontalScrollBar.setValue(horizontalScrollBar.getMinimum());
}
 
開發者ID:igr,項目名稱:swingspy,代碼行數:10,代碼來源:SwingUtil.java

示例4: appendLine

import javax.swing.JScrollPane; //導入方法依賴的package包/類
public void appendLine(final JTextArea textArea, final JScrollPane scrollPane, final String line)
{
    try
    {
        latch.await();
    } catch (InterruptedException e){} //Prevent logging until after constructor has ended.
    if (!SwingUtilities.isEventDispatchThread())
    {
        SwingUtilities.invokeLater(new Runnable()
        {
            public void run()
            {
                MinecraftServerGui.this.appendLine(textArea, scrollPane, line);
            }
        });
    }
    else
    {
        Document document = textArea.getDocument();
        JScrollBar jscrollbar = scrollPane.getVerticalScrollBar();
        boolean flag = false;

        if (scrollPane.getViewport().getView() == textArea)
        {
            flag = (double)jscrollbar.getValue() + jscrollbar.getSize().getHeight() + (double)(SERVER_GUI_FONT.getSize() * 4) > (double)jscrollbar.getMaximum();
        }

        try
        {
            document.insertString(document.getLength(), line, (AttributeSet)null);
        }
        catch (BadLocationException var8)
        {
            ;
        }

        if (flag)
        {
            jscrollbar.setValue(Integer.MAX_VALUE);
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:43,代碼來源:MinecraftServerGui.java


注:本文中的javax.swing.JScrollPane.getVerticalScrollBar方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。