Java – Adding spacing between elements in JMenuBar

javajmenubarswing

Elements such as File, Edit etc. are too close together when using the JMenuBar in my application, it would look much nicer if there were some space between the elements. Is this possible?

Best Answer

Yes, just add MenuBar item with empty text in it and make it not clickable/selectable