I'm taking my third class in Java. The last 3 weeks have been on GUI stuff (which I've never done before), and I can't figure this out.
//Create the menu bar.
JMenuBar myJMenuBar = new JMenuBar();
//Build the first menu.
JMenu fileMenu = new JMenu("File");
fileMenu.getAccessibleContext().setAccessibleDescription("The file menu.");
myJMenuBar.add(fileMenu);
... I insert more menu items here, which probably aren't important ...
frame.setJMenuBar(myJMenuBar);
When I run the program, I see my JFrame, but the JMenuBar object doesn't show up until I resize the window. Any idea on why it isn't showing it initially?
Well you went down the locked down console route. LOL I would be interested in a bloat free, game optimized Windows experience in a system that requires less maintenance.
Question
struct
I'm taking my third class in Java. The last 3 weeks have been on GUI stuff (which I've never done before), and I can't figure this out.
//Create the menu bar. JMenuBar myJMenuBar = new JMenuBar(); //Build the first menu. JMenu fileMenu = new JMenu("File"); fileMenu.getAccessibleContext().setAccessibleDescription("The file menu."); myJMenuBar.add(fileMenu); ... I insert more menu items here, which probably aren't important ... frame.setJMenuBar(myJMenuBar);
When I run the program, I see my JFrame, but the JMenuBar object doesn't show up until I resize the window. Any idea on why it isn't showing it initially?
Link to comment
https://www.neowin.net/forum/topic/252542-java-jmenubar-not-appearing-until-window-resized/Share on other sites
8 answers to this question
Recommended Posts