Link to home
Start Free TrialLog in
Avatar of charliebaby
charliebaby

asked on

some lines compile some don't

below are snipets of my code. As you see I note that some lines compile some don't. what is wrong with the snippets that don't ? thanks



JMenuBar menuBar;//compiles must be right
 menuBar = new JMenuBar();// compiles must be right

JMenu menu = new JMenu("Menu Label");// compiles must be right
    menuBar.add(menu);// compiles must be right

 JMenuItem item = new JMenuItem("Item Label");// compiles must be right

 //frame.setJMenuBar(menuBar);//doesn't compile, what is wrong?  
//item.addActionListener(actionListener);//doesn't compile, what is wrong?

 menu.add(item); // compiles must be right

 // frame.setJMenuBar(menuBar);//doesn't compile, what is wrong?
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of charliebaby
charliebaby

ASKER

Great, I am so beat, will put this to practice tomorrow and post new question as I progress, Thanks again