How to set a size for JMenuItem?
As you can see, it's ugly to have these kind of JMenuItem s. The width of the menu items is quite small. Here is the code: JMenu menuOne=new JMenu("MenuOne"); JMenu menuTwo=new JMenu("MenuTwo"); JMenu menuThree=new JMenu("MenuThree"); JMenu menuFour=new JMenu("MenuFour"); JMenuBar mbar=new JMenuBar(); //add the menu to menubar mbar.add(menuOne); JMenuItem OneItOne=new JMenuItem("1"); JMenuItem OneItTwo=new JMenuItem("2"); menuOne.add(OneItOne); menuOne.addSeparator(); menuOne.add(OneItTwo); mbar.add(menuTwo); mbar.add(menuThree); mbar.add(menuFour); setJMenuBar(mbar); Simply adding some blanks