[5710] in java-interest

home help back first fref pref prev next nref lref last post

'this'

daemon@ATHENA.MIT.EDU (Heather Swayne)
Fri Feb 23 15:14:16 1996

Date: Fri, 23 Feb 1996 08:04:19 PST
From: Heather Swayne <hswayne@wrc.xerox.com>
To: java-interest@java.sun.com

Does anyone out there have a working example of how to use 'this'.  

I am trying to define an object, 'Pt', that if passed no argument will create a 
GUI and get the uses input.  The problem is in passing the GUIfile(this) and then 
not being able to access any of the varubles defined within the class Pt

 
      class Pt extends Object{
         public int val;
 
         public Pt(){
           new GUIfile().foo(this)
 }

----------------------------------------------------
above and below are saved in two diffrent java files.
	do to true length of the files.
-----------------------------------------------------

         class GUIfile extends Applet{
 
 ...
         public void foo(Pt P){

		P.val = 5;  // pure input for testing 
}


The errorthat I get is always:  
	Undefined variable: P
                 in        P.val = 5;
 


 Would greatly appreciate your help,
         Heather Swayne
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post