Example usage for javax.swing JScrollPane getComponent

List of usage examples for javax.swing JScrollPane getComponent

Introduction

In this page you can find the example usage for javax.swing JScrollPane getComponent.

Prototype

public Component getComponent(int n) 

Source Link

Document

Gets the nth component in this container.

Usage

From source file:org.datacleaner.widgets.DCFileChooser.java

private void setFilePaneBackground(Container container, Color bg) {
    Component[] children = container.getComponents();
    for (Component component : children) {
        if (component instanceof JScrollPane) {
            // the "file pane" (the component containing the list of files)
            // is placed inside a JScrollPane
            JScrollPane scroll = (JScrollPane) component;
            setContainerBackground(scroll.getComponent(0), bg);
        } else if (component instanceof Container) {
            setFilePaneBackground((Container) component, bg);
        }//from   w  w  w  .  j  a  va  2 s  . c o  m
    }
}