I had the same problem and solved it by setting JFrame visible AFTER the code for the menu. So, first create a JFrame , then add a JMenuBar and finally: frame.setVisible(true); (my frame is simply called a "frame", replace the "frame" with the name of your frame)
Marko source share