The best way is to let system handle the width and height (a call to super should give you the correct width and height which will display the full text contents)
Although if you want explicitly setting the width to 100 and height to 25, setPreferredSize() is one way.. Another way is to use Box Layout
menuBar.add(Box.createRigidArea(new Dimension(100,25)));