Java JScrollPane findScrollPane(Component component)

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

Description

find Scroll Pane

License

Open Source License

Declaration

private static JScrollPane findScrollPane(Component component) 

Method Source Code


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

import java.awt.Component;
import java.awt.Container;

import javax.swing.JScrollPane;

public class Main {
    private static JScrollPane findScrollPane(Component component) {
        if (component instanceof JScrollPane)
            return (JScrollPane) component;

        if (component instanceof Container) {
            Container c = (Container) component;
            for (int i = 0; i < c.getComponentCount(); i++) {
                JScrollPane result = findScrollPane(c.getComponent(i));
                if (result != null)
                    return result;
            }//from w  w  w.  j a v  a 2s  . co m
        }
        return null;
    }
}

Related

  1. createScrollPane(JComponent content)
  2. createSelfManagedScrollPane(final Component view, final JComponent parentToRevalidate)
  3. defaultAutoScroll(JComponent comp, Point cursorLocn)
  4. defaultGetAutoscrollInsets(JComponent comp)
  5. findScrollPane(Component c)
  6. getContainingScroll(Component comp)
  7. getMessageScrollPane(String message)
  8. getNoScrollPaletteWindow(Component gui, String windowName, ComponentListener cl)
  9. getScrollableMessage(String msg)