Java JScrollPane setScrollpane(JScrollPane scrollpane)

Here you can find the source of setScrollpane(JScrollPane scrollpane)

Description

OS X shows scrollpanes even if there is no data to scroll.

License

Open Source License

Parameter

Parameter Description
scrollpane a parameter

Declaration

public static void setScrollpane(JScrollPane scrollpane) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.JScrollPane;

public class Main {
    /**// w ww  .  ja v a  2s  .  c om
     * OS X shows scrollpanes even if there is no data to scroll. This method
     * reads the scrollbar.horizontal property created by this program to
     * determine which scrollpane style to use.
     * 
     * @param scrollpane
     */
    public static void setScrollpane(JScrollPane scrollpane) {
        scrollpane.setHorizontalScrollBarPolicy(Integer.parseInt(System.getProperty("scrollbar.horizontal")));
        scrollpane.setVerticalScrollBarPolicy(Integer.parseInt(System.getProperty("scrollbar.vertical")));
    }
}

Related

  1. scrollToTop(final JScrollPane scrollPane)
  2. scrollToTop(JScrollPane scrollPane)
  3. scrollToTopLater(final JScrollPane scrollPane)
  4. scrollToVisible(Component comp, JScrollPane parent)
  5. setDefaultScrollbarUnits(JScrollPane scrollPane)
  6. setScrollPaneSize(JScrollPane scrollPane, int rows, int columns)
  7. setUnitIncrement(JScrollPane scroller)
  8. show(JComponent comp, String windowName, boolean hasScrollBars, int x, int y, int width, int height)
  9. toScrollPane(Component component, Point componentPoint, Point resultPoint)