create JMenu - Java Swing

Java examples for Swing:JMenu

Description

create JMenu

Demo Code

/**// www .j a  v a2 s.c  o  m
 * Menu creation helper functions
 *
 * @author Tamara Orr
 * See MIT license in license.txt
 */
//package com.java2s;

import javax.swing.JMenu;

public class Main {
    public static JMenu createMenu(final String text) {
        return new JMenu(text);
    }

    public static JMenu createMenu(final String text, final int mnemonic) {
        JMenu menu = createMenu(text);
        menu.setMnemonic(mnemonic);
        return menu;
    }
}

Related Tutorials