🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #13167

Re: Menu Bar.. what am I doing wrong

#13167
From: Suneet Shah
Date: Wed, 16 Sep 1998 00:00
55 lines
2024 bytes
Did you try to run the code to see what happens?

Here is a sample - I shows how the menu bar is added and how you may respond
to a menu choice.

Suneet

public class main extends JApplet
{
  boolean isStandalone = false;
  JMenuBar menuBar = new JMenuBar();
  JMenu View = new JMenu();
  JMenuItem jMenuItmInventory = new JMenuItem();
  JMenuItem jMenuItmVendor = new JMenuItem();
...

  private void jbInit() throws Exception
  {
    this.setSize(500,400);
    this.setJMenuBar(menuBar);
    View.setLabel("View");
    jMenuItmInventory.setLabel("Inventory");
    jMenuItmInventory.addMouseListener(new java.awt.event.MouseAdapter()
    {
      public void mousePressed(MouseEvent e)
      {
        jMenuItmInventory_mousePressed(e);
      }
    });
    jMenuItmVendor.setLabel("Vendor");
      jMenuItmVendor.addMouseListener(new java.awt.event.MouseAdapter()
    {
      public void mousePressed(MouseEvent e)
      {
        menu_mousePressed(e);
      }
    });
    menuBar.add(View);
    View.add(jMenuItmInventory);
    View.add(jMenuItmVendor);
  }


Steve Nelson wrote in message <35FF5D54.731205E9@ns.net>...
>Hi,
>
>    New to JBuilder.. Trying to use the Swing component Menu Bar and
>after compile and run when I drop it down it looks like it goes behind
>some of my other components.. ie. a radio button..  but not the tool bar
>and buttons on it..
>
>    Does anyone know what I'm doing wrong??
>
>     Thank you for any assistance you may render... Steve
>
Technical Details
Message-ID: <6to7lv$2hh5@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <35FF5D54.731205E9@ns.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,bcb20eb7380eafc
X-Google-Attributes: gid111d45,public
From: "Suneet Shah" <suneet@diamelle.com>
Subject: Re: Menu Bar.. what am I doing wrong
Date: 1998/09/16
Message-ID: <6to7lv$2hh5@forums.borland.com>
X-Deja-AN: 391677199
References: <35FF5D54.731205E9@ns.net>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing