This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

to make menu bar  RSS feed

mandeep singh
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import javax.swing.*;
import java.awt.*;
public class fj
JFrame ff;
JMenuBar mb;
JMenu mFile,MEdit;
JMenuItem mNew,mClose,mCopy,mPaste;
JCheckBoxMenuItem mPrint;
JMenu mFont;
public fj()
ff=new JFrame("");
mb=new JMenuBar();
mFile=new JMenu("File");
mEdit=new JMenu("Edit");
mNew=new JMenuItem("New");
mClose=new JMenuItem("Close");
mCopy=new JMenuItem("Copy");
mPaste=new JMenuItem("Paste");
mPrint=new JCheckBoxMenuItem("Print");
mFont=new JMenu("Font");
mFont.add("Times New Roman");
public static void main(String args[])
fj f1=new fj();

dear friends this programme giving 5 errors..Help me please
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Help me please

read what the first error says, fix it, recompile - see if there's any more errors.
repeat above, if necessary.

hint: java is case-sensitive
Campbell Ritchie
Posts: 53764
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use the code button underneath the message window when quoting code; it makes it easier to read. Please quote details of the error messages; those of us who are more experienced can tell from the messages what is going wrong. Have a look at these FAQs.

Welcome to JavaRanch

Michael Dunn has already given you a big hint about what the errors mean. In fact you have two errors, not five; one of them appears 4 times. Take Michael's hint about cases. Note the name of the variable it complains about, and go back to where you declared it.
You also need to be very careful about spelling. Look in the API documentation and check the exact spelling of the methods.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!