Article View: borland.public.jbuilder.java.language
Article #14639Re: hiding methods
From: Dillan Fernando
Date: Mon, 09 Aug 1999 00:00
Date: Mon, 09 Aug 1999 00:00
38 lines
1506 bytes
1506 bytes
Hi,
The java.awt.Container has a method called addImpl(..),
This takes three parameters (addImpl(Component comp, Object constraints, int
index)
When someone adds any component, this method is called automatically. So you
can overide this method to check what components are dropped onto you panel.
ie:
public void addImpl(Component comp, Object constraints, int index)
{ if(comp instanceof Button)
// do nothing
else super(comp, constraints, index);
}
Hope this helps
Kind Regards
Dillan Fernando
Marcel van den Dungen wrote in message <37A94A3C.7124DC62@c-content.nl>...
>hi,
>
>i am creating a class that extends Panel and has antoher panel and
>scrollbar laid out with the borderlayout. i want the users of this class
>to be unable to add other components, change the layout and other
>things. does anyone have a clue on how to achieve this, or is this
>inpossible for oop reasons?
>
>hoping that someone can help me out
>tia
>greetings
>casper
>
Technical Details
Message-ID:
<7onju2$8ce10@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37A94A3C.7124DC62@c-content.nl>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,c7695f50bddab9ba X-Google-Attributes: gidf74b3,public From: "Dillan Fernando" <dillan@geocities.com> Subject: Re: hiding methods Date: 1999/08/09 Message-ID: <7onju2$8ce10@forums.borland.com> X-Deja-AN: 510820378 References: <37A94A3C.7124DC62@c-content.nl> Organization: Another Netscape Collabra Server User X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Newsgroups: borland.public.jbuilder.java.language