I played around with the code and I removed 'frame.' from the setJMenuBar() method and it worked. Thanks man
Type: Posts; User: mwardjava92
I played around with the code and I removed 'frame.' from the setJMenuBar() method and it worked. Thanks man
Yes line 87 was in the main() method. I moved the code to the constructor, but now I am getting this error:
MenuExample.java:76: cannot find symbol
symbol : variable frame
location: class...
MenuExample.java:87: non-static variable menuBar cannot be referenced from a static context
frame.setJMenuBar(menuBar);
^
I've tried adding 'frame.setJMenuBar(menuBar);' but it gives me an error. Am I on the right track?
I have created 2 JMenus with various JButtons, JCheckboxes and a submenu. They are compiling and running ok. The problem is that they filling the full length of the JFrame, instead of appearing as...