GetBrowser METHOD 
Author Message
 GetBrowser METHOD

    I'm trying to combine an APPLET with vrml but when I compile "javac
myapplet.java" I get the following error:

    myapplet.java:7: No method matching getBrowser() found in class
vrml.external.Browser.
                Browser b = Browser.getBrowser();
                                              ^
    1 error

    I've set up the CLASSPATH correctly in AUTOEXEC.BAT
(c:\java\classes\vrml, where COSMO classes are installed), but I think it's
not the problem.
    I've installed either COSMO v1 and COSMO v2.11 classes but I get the
same
error.

MYAPPLET.JAVA reads like this (code taken from the book "LATE NIGHT, VRML
WITH
JAVA"):

import java.applet.*;
import vrml.external.*;
import vrml.external.field.*;

public class myapplet extends Applet {
 public void start() {
  Browser b = Browser.getBrowser();
  Node aTransform = b.getNode("some_transform");
  EventInSFVec3f tx = (EventInSFVec3f)aTransform.getEventIn("translation");

  float new_position[] = {0,1,0.5f};
  tx.setValue(new_position);
 }

Quote:
}

    Thanx in advance


Mon, 30 Sep 2002 03:00:00 GMT  
 GetBrowser METHOD

The getBrowser method has two flavors:

public static Browser getBrowser(java.applet.Applet applet)
public static Browser getBrowser(java.applet.Applet applet, java.lang.String
frameName, int index)

You want something like;

Browser b = Browser.getBrowser( this );

-Rex

Quote:

>     I'm trying to combine an APPLET with VRML but when I compile "javac
> myapplet.java" I get the following error:

>     myapplet.java:7: No method matching getBrowser() found in class
> vrml.external.Browser.
>                 Browser b = Browser.getBrowser();
>                                               ^
>     1 error

>     I've set up the CLASSPATH correctly in AUTOEXEC.BAT
> (c:\java\classes\vrml, where COSMO classes are installed), but I think it's
> not the problem.
>     I've installed either COSMO v1 and COSMO v2.11 classes but I get the
> same
> error.

> MYAPPLET.JAVA reads like this (code taken from the book "LATE NIGHT, VRML
> WITH
> JAVA"):

> import java.applet.*;
> import vrml.external.*;
> import vrml.external.field.*;

> public class myapplet extends Applet {
>  public void start() {
>   Browser b = Browser.getBrowser();
>   Node aTransform = b.getNode("some_transform");
>   EventInSFVec3f tx = (EventInSFVec3f)aTransform.getEventIn("translation");

>   float new_position[] = {0,1,0.5f};
>   tx.setValue(new_position);
>  }
> }

>     Thanx in advance



Tue, 01 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. java and the getbrowser method...

2. EAI: getBrowser

3. VRML and javasrcipt function "getbrowser"

4. EAI: getBrowser(Applet,frame,index)

5. eai: getBrowser / start-stop TimeSensor question

6. (Browser.getBrowser)Problem.

7. eai getBrowser trouble

8. getBrowser problem (EAI)

9. EAI,Cosmo Player: getBrowser return NullPointerException!

10. getBrowser() problem in EAI

11. pb with EAI, getBrowser() doesn't work

12. getBrowser on separate window?

 

 
Powered by phpBB® Forum Software