Java JScrollPane Create getScrollPane(Component component)

Here you can find the source of getScrollPane(Component component)

Description

Get the JScrollPane that contains the passed in component.

License

Open Source License

Declaration

public static JScrollPane getScrollPane(Component component) 

Method Source Code


//package com.java2s;
import java.awt.Component;

import javax.swing.JScrollPane;

import javax.swing.SwingUtilities;

public class Main {
    /**/*from ww  w . j a  va2s. c  o m*/
     * Get the JScrollPane that contains the passed in component.
     * Returns null if the component is not in a JScrollPane.
     */
    public static JScrollPane getScrollPane(Component component) {
        return ((JScrollPane) SwingUtilities.getAncestorOfClass(JScrollPane.class, component));
    }
}

Related

  1. getScrollPane( Component innerComponent)
  2. getScrollPane(BasicComboPopup popup)
  3. getScrollPane(Component component)
  4. getScrollPane(Component innerComponent)
  5. getScrollPane(final Component component)
  6. getScrollPaneAncestor(Component c)