I am just started learning Java and I've been reading through this documentation. I don't like to copy a bunch of code and paste it. So I have been trying to work my way through the documentation one thing at at time.
I already have a working JFrame and decided I would start by adding a menu.
HERE IS MY CODE:
package mainframe;
import javax.swing.*;
public class menuBar extends JMenuBar {
JMenuBar mainMenu = JMenuBar("Menu");
}
MY ERROR:
error: cannot find symbol
JMenuBar mainMenu = JMenuBar("Menu");
symbol: method JMenuBar(String)
location: class menuBar
1 error
So anyways. I am not really sure what the "cannot find symbol error" means. Maybe I am searching wrong. But every time I Google it it takes me to more complex questions with no clear answer. Any advice as to what I am doing wrong and or to what the cannot find symbol error means would be very much appreciated. Thanks in advance.