[1543] in java-interest
Re: The Window of an Applet??
daemon@ATHENA.MIT.EDU (Scott Treacy)
Thu Sep 7 10:01:46 1995
Date: Thu, 7 Sep 1995 11:58:14 +0000
To: java-interest@java.sun.com
From: S.P.Treacy@scotborders.co.uk (Scott Treacy)
>Hi guys,
>
>I tried to do that, but (item.x,item.y) still refers to the origin of the
>html document rather than the applet. As a result, all my TextAreas are
>clustered at the top-left corner of the html document, even though they
>are from different applets within the html document.
>
>> Hi Henry:
>>
>> You can try to use Applet.item.parent as the parent to construct the
>> TextAreas, Windows etc, and using item.x and item.y (the origin of Applet)
>> as the start point to position your objects.
>>
>> Lin
I had problems with this too... I finally sorted it out though;
1/ the referance is; this.item.x / y
2/ It must be called from within the applet <My Applet> class NOT
<Other> class used by <My Applet>.
3/ To do that you must pass 'this' to your <other> class as its parent.
4/ That means the referance is now; parent.item.x / y
What I have not sorted out yet, is the fact that this will not take into
account use of the browser scroll bar. There are variables scrollX / Y in
the browser displayItemWindow but these are protected. There is a getScrollY
method but I have not looked at it yet.
The other problem with this is the co-ord's returned from the mouse pointer
have an origin with the applet and these take scroll into account.
A real mess but from talking to Jonathan Payne he helped me sort it out and
has told me it will all be sorted out with the beta awt. The other thing to
bare in mind is any solution to this using an alpha, will be proprietry.
Regards
Scott
Scott P. Treacy - Java Development Team, TweedNet, Calligrafix
aka Email: S.P.Treacy@elgeebar.scotborders.co.uk
Elgeebar Tel: +44 (0) 1896 870490 Fax: +44 (0) 1896 757965
#question:UN Smail: 17 Park Villa, Walkerburn, Borders.Scotland. EH43 4AN.
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com