Source Code : Separating Menu Items in a Menu
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Separating Menu Items in a Menu
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JSeparator;
public class Main {
public static void main(String[] argv) throws Exception {
JMenu menu = new JMenu("Menu Label");
JMenuItem item1 = new JMenuItem("Item Label");
menu.add(item1);
// Add separator
menu.add(new JSeparator());
// Add another menu item
JMenuItem item2 = new JMenuItem("Item Label");
menu.add(item2);
}
}
Thank with us