I have added an image to the menu item but in the same menu I used a checkbox item and the result is not very appealing to the eye.. The tick box and the image is not vertically aligned as the other menu item's images. How can I solve this and why this is happenning? JCheckBoxMenuItem's image is that tick box, isn't it?
JMenu menu_project = new JMenu("Project");
menu_project.setMnemonic(KeyEvent.VK_P);
menubar.add(menu_project);
JMenuItem menuitem_setinputparam = new JMenuItem("Set input parameters");
menuitem_setinputparam.setMnemonic(KeyEvent.VK_I);
menuitem_setinputparam.addActionListener(listener);
menu_project.add(menuitem_setinputparam);
JMenuItem menuitem_showoutput = new JCheckBoxMenuItem("Show all output at the end");
menuitem_showoutput.setMnemonic(KeyEvent.VK_O);
menuitem_showoutput.addActionListener(listener);
menu_project.add(menuitem_showoutput);
menu_project.addSeparator();
JMenuItem menuitem_statistics = new JMenuItem("Statistics", new ImageIcon(this.getClass().getResource("assets/menuitem_statistics.png")));
menuitem_statistics.setMnemonic(KeyEvent.VK_S);
menuitem_statistics.addActionListener(listener);
menuitem_statistics.setToolTipText("Overview your flow.");
menu_project.add(menuitem_statistics);