Java JScrollPane moveEnd(JScrollPane pane)

Here you can find the source of moveEnd(JScrollPane pane)

Description

Move the cursor to the end of ScrollPane.

License

Open Source License

Parameter

Parameter Description
pane the ScrollPane

Declaration

public static void moveEnd(JScrollPane pane) 

Method Source Code

//package com.java2s;
/*/*  w ww.  j a  v  a 2 s .co m*/
 * Hello Minecraft!.
 * Copyright (C) 2013  huangyuhui <huanghongxun2008@126.com>
 *
 * 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.gnu.org/licenses/}.
 */

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

public class Main {
    /**
     * Move the cursor to the end of ScrollPane.
     *
     * @param pane the ScrollPane
     */
    public static void moveEnd(JScrollPane pane) {
        JScrollBar bar = pane.getVerticalScrollBar();
        bar.setValue(bar.getMaximum());
    }
}

Related

  1. isHorizontalScrollBarHiddenAlways(JScrollPane pane)
  2. isScrolledToBottom(final JScrollPane scrollPane)
  3. makeComponentDragScrollable(final JComponent component)
  4. makeListInScrollPane(Collection items, Function namer)
  5. makeVScroller(Component c)
  6. newJScrollPane(String title, Component c)
  7. resetScrollPane(final JScrollPane scrollPane)
  8. scrollToBottom(final JScrollPane scrollPane)
  9. scrolltoHomePosition(JScrollPane jScrollPane1)