Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
// The MIT License (MIT)

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

import javax.swing.JMenu;

public class Main {
    private static Component[] getComponents(Container container) {
        return container instanceof JMenu ? ((JMenu) container).getMenuComponents() : container.getComponents();
    }
}