All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.nih.nlm.nls.lvg.Tools.GuiTool.GuiLib.LibMenu Maven / Gradle / Ivy

The newest version!
package GuiTool.GuiLib;
import javax.swing.*;
public class LibMenu
{
    private LibMenu()
    {
    }
    // public methods
    public static JMenu MakeMenu(Object parent, Object[] items, Object target)
    {
        JMenu m = null;
        if(parent instanceof JMenu)
        {
            m = (JMenu) parent;
        }
        else if(parent instanceof String)
        {
            m = new JMenu((String) parent);
        }
        else
        {
            return null;
        }
        for(int i = 0; i < items.length; i++)
        {
            if(items[i] == null)        // add a separator if input is null
            {
                m.addSeparator();
            }
            else
            {
                m.add(LibPopupMenu.MakeMenuItem(items[i], target));
            }
        }
        return m;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy