Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: applet menubar

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    12
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default applet menubar

    hi,
    how do i create a menubar for an applet?

    thanks


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: applet menubar

    If you extended JApplet, you can use the setJMenuBar() method:

    public void init()
    {
         JMenuBar myMenu = new JMenuBar();
         JMenu main = new JMenu("menu1");
         JMenuItem item = new JMenuItem("Item1");
         main.add(item);
         myMenu.add(main);
         this.setJMenuBar(myMenu);
    }

  3. The Following User Says Thank You to helloworld922 For This Useful Post:

    tabutcher (March 5th, 2010)

  4. #3
    Junior Member
    Join Date
    Mar 2010
    Posts
    12
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Re: applet menubar

    thanks
    much appreciated

Similar Threads

  1. Deploying an applet with jsp
    By IamKira in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: January 27th, 2010, 08:28 AM
  2. applet fail
    By wolfgar in forum What's Wrong With My Code?
    Replies: 7
    Last Post: January 21st, 2010, 06:24 AM
  3. [SOLVED] applet vs. gui app
    By rptech in forum AWT / Java Swing
    Replies: 3
    Last Post: August 27th, 2009, 09:13 AM
  4. applet and JPS problem.... please help me
    By rockster14 in forum Java Applets
    Replies: 0
    Last Post: August 7th, 2009, 03:59 PM
  5. Problem of implementing mathematic logic in Java applet
    By AnithaBabu1 in forum Java Applets
    Replies: 0
    Last Post: August 15th, 2008, 11:42 PM