Example usage for javax.swing JScrollPane getHorizontalScrollBarPolicy

List of usage examples for javax.swing JScrollPane getHorizontalScrollBarPolicy

Introduction

In this page you can find the example usage for javax.swing JScrollPane getHorizontalScrollBarPolicy.

Prototype

public int getHorizontalScrollBarPolicy() 

Source Link

Document

Returns the horizontal scroll bar policy value.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    JTextArea textArea = new JTextArea();
    JScrollPane pane = new JScrollPane(textArea);

    // Get the default scrollbar policy
    int hpolicy = pane.getHorizontalScrollBarPolicy();
    // JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED;

    int vpolicy = pane.getVerticalScrollBarPolicy();
    // JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED;
}

From source file:Main.java

public static boolean isHorizontalScrollBarHiddenAlways(JScrollPane pane) {
    return (pane != null) && (pane.getHorizontalScrollBarPolicy() == JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
}