🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #17235

Re: Inheriting a menu

#17235
From: Greg Hamer
Date: Sun, 06 Dec 1998 00:00
35 lines
1906 bytes
It sounds like it should work. CommonMenu should have a setMenuBar property
setting that sets up the common menus, and the classes that extend it could
add to it with getMenuBar().add(Menu). For things to show up as children of
the Frame sounds like you used JMenu or JMenuBar by accident. They extend
component, so  the add will do the wrong thing.

Leo Cohen wrote:

> I am using a frame control that extends DecoratedFrame and requires a
> menu. Two other controls also extend DecoratedFrame and require the same
> menu. If I could get each of the 3 frame controls to _inherit_ a class
> that included only the common menu, I would be able to modify the menu
> structure in one place and have it support all of the controls
> identically.
>
> However, when I have experimented with this by having my control extend
> CommonMenu which extends DecoratedFrame, the run time menu commands
> turn  up on the frame itself, not in a menu panel - or that's how it
> looks.
>
> Question 1 - Is this a feasible thing to ask of Java/JBuilder, or am I
> whistling into the wind?
>
> Question 2 - If feasible, how can I get the menu look that I get out of
> the straight up way of doing things?
> --
> Leo Cohen
>
> 116-1 Howard Drive
> Charlottesville, VA  22903
>
> 804-243-8922 (UVA)
> 804-244-4648 (home)
> 804-244-7922 (fax)
> lcohen@cs.virginia.edu
Technical Details
Message-ID: <366B6056.F0F9DF0E@inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <36658BE0.8BE7584F@cs.virginia.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,9078b8939a276a67
X-Google-Attributes: gidf74b3,public
From: Greg Hamer <ghamer@inprise.com>
Subject: Re: Inheriting a menu
Date: 1998/12/06
Message-ID: <366B6056.F0F9DF0E@inprise.com>
X-Deja-AN: 419520494
Content-Transfer-Encoding: 7bit
References: <36658BE0.8BE7584F@cs.virginia.edu>
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language