Java JScrollPane scrolltoHomePosition(JScrollPane jScrollPane1)

Here you can find the source of scrolltoHomePosition(JScrollPane jScrollPane1)

Description

scrollto Home Position

License

Open Source License

Declaration

public static void scrolltoHomePosition(JScrollPane jScrollPane1) 

Method Source Code

//package com.java2s;
/**//from w w w. j av a  2  s .  c  om
 * @author David Garratt
 * 
 * Project Name : Commander4j
 * 
 * Filename     : JUtility.java
 * 
 * Package Name : com.commander4j.util
 * 
 * License      : GNU General Public License
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the 
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public 
 * License along with this program.  If not, see
 * http://www.commander4j.com/website/license.html.
 * 
 */

import javax.swing.JScrollBar;
import javax.swing.JScrollPane;

public class Main {
    public static void scrolltoHomePosition(JScrollPane jScrollPane1) {
        JScrollBar verticalScrollBar = jScrollPane1.getVerticalScrollBar();
        JScrollBar horizontalScrollBar = jScrollPane1.getHorizontalScrollBar();
        verticalScrollBar.setValue(verticalScrollBar.getMinimum());
        horizontalScrollBar.setValue(horizontalScrollBar.getMinimum());
    }
}

Related

  1. makeVScroller(Component c)
  2. moveEnd(JScrollPane pane)
  3. newJScrollPane(String title, Component c)
  4. resetScrollPane(final JScrollPane scrollPane)
  5. scrollToBottom(final JScrollPane scrollPane)
  6. scrollToTop(final JScrollPane scroller, int delay)
  7. scrollToTop(final JScrollPane scrollPane)
  8. scrollToTop(JScrollPane scrollPane)
  9. scrollToTopLater(final JScrollPane scrollPane)