Article View: borland.public.jbuilder.java.swing
Article #11113Re: strange line of code in JComponent
From: wim.van.leuven
Date: Thu, 08 Jul 1999 00:00
Date: Thu, 08 Jul 1999 00:00
33 lines
1700 bytes
1700 bytes
In article <377CC133.35630EB9@tamedia.ch>,
Roman Huerlimann <Roman.Huerlimann@tamedia.ch> wrote:
> Hi
>
> I found the following code in java 1.2.2 source code from JComponent
>
> 2553: /**
> * Resizes this object so that it has width width and height.
> *
> * @param d - The dimension specifying the new size of the
> object.
> */
> public void setSize(Dimension d) {
> JComponent.this.setSize(d);
> 2560: }
>
> As far as I understand this it calls itself again. This would be an
> endlos loop, which I guess can't be. So what is done here?
>
> Can anybody explain this to me?
>
This code snippet comes indeed from the JComponent source file, but
is a method definition on an inner class, namely AccessibleJComponent,
so what this code does is to map the call to an accessible JComponent,
to a call to the method of it's standard JComponent.
Hope this helps.
Wim Van Leuven.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Technical Details
Message-ID:
<7m2hg6$evn$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<377CC133.35630EB9@tamedia.ch>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,4f348b9972d5243e X-Google-Attributes: gid111d45,public From: wim.van.leuven@watco.be Subject: Re: strange line of code in JComponent Date: 1999/07/08 Message-ID: <7m2hg6$evn$1@nnrp1.deja.com> X-Deja-AN: 498640915 References: <377CC133.35630EB9@tamedia.ch> X-Http-Proxy: 1.0 x29.deja.com:80 (Squid/1.1.22) for client 193.74.148.91 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Thu Jul 08 15:52:43 1999 GMT Newsgroups: borland.public.jbuilder.java.swing X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)