Search code examples
javaswingjmenubar

Adding spacing between elements in JMenuBar


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?


Solution

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