Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import java.awt.Component;

import javax.swing.JTabbedPane;

public class Main {
    public static JTabbedPane getJTabbedPaneAncestor(Component c) {
        while (c != null) {
            if (c instanceof JTabbedPane) {
                return (JTabbedPane) c;
            }
            c = c.getParent();
        }
        return null;
    }
}