Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import javax.swing.*;

public class Main {
    public static JMenu menu(String name, JMenuItem... items) {
        final JMenu menu = new JMenu(name);
        for (JMenuItem item : items) {
            if (item != null) {
                menu.add(item);
            } else {
                menu.addSeparator();
            }
        }
        return menu;
    }
}