Solved

some lines compile some don't

Posted on 2006-11-03
2
189 Views
Last Modified: 2010-03-31
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?
0
Comment
Question by:charliebaby
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 17872206
//frame.setJMenuBar(menuBar);//doesn't compile, what is wrong?  

should be:

setJMenuBar(menuBar);

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

actionListener is not defined
0
 

Author Comment

by:charliebaby
ID: 17872237
Great, I am so beat, will put this to practice tomorrow and post new question as I progress, Thanks again
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Application launch issue with Apache Tomcat 5 64
Oracle SQL syntax check  without executing 6 75
java stored proc example 9 44
ejb mdb examples 1 8
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question