Thank you very much. It worked as i expected!

----- Original Message -----
From: Jacky Rymasz <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 19, 2003 11:26 AM
Subject: [JAVA3D] Rιf. : [JAVA3D] Unfixed Error, please your help [analysι
par anti-virus CCAMA : OK]


>
>  Theproblem comes from this piece of code in your class Texttest:
>
> Polyhedron polyhedron[]=new Polyhedron[Vertices.length];
> file://Exception in thread "main" java.lang.NullPointerException
> file://ADD THE POLYHEDRON(s)
> for(int i=0;i<Vertices.length;i++) {
>
>
group.addChild(polyhedron[i].getPolyedron(Vertices,Facets,VertexNo,VerticesN
o[i],SumOfFacets[i],SumOfFacetsNo[i],i));
> }
>
> You create an array of Polyhedron object which are null. And then you
parse
> the array and call a method of each Polyhedron objects (which are null
> hence the NullPointerException).
>
> Set your getPolyedron() method as static.. it should work (don't forget to
> move your shape and tg within the method).
> or... why don't you call the creation code of your object (code within the
> getPolyedron() method) in the constructor and have a getTransformGroup()
> method?
> So in your Textest class, you call:
>
> Polyhedron polyhedron[]=new Polyhedron[Vertices.length];
> file://Exception in thread "main" java.lang.NullPointerException
> file://ADD THE POLYHEDRON(s)
> Polyhedron tempPoly;
> for(int i=0;i<Vertices.length;i++) {
>       tempPoly  = new
>
Polyhedron(Vertices,Facets,VertexNo,VerticesNo[i],SumOfFacets[i],SumOfFacets
No[i],i);
>       group.addChild(tempPoly.getTransformGroup());
>       /* If you want to fill in your array of created polyhedrons */
>       polyhedron[i] = tempPoly;
>
> }
>
>
> Jack
>
>
>
>
>
>                       Γιάννης

>                       <[EMAIL PROTECTED]>        Pour :
[EMAIL PROTECTED]
>                       Envoyé par :               cc :
>                       Discussion list for        Objet :   [JAVA3D]
Unfixed Error, please your help [analysé par anti-virus CCAMA
>                       Java 3D API                 : OK]
>                       <[EMAIL PROTECTED]
>                       VA.SUN.COM>
>
>
>                       19/06/03 09:45
>                       Veuillez répondre �
>                       Discussion list for
>                       Java 3D API
>
>
>
>
>
>
> I cannot fix my error, my error is Exception in thread "main"
> java.lang.NullPointerException
>
> Could you test my Testtest class? And enlighten me.
>
> The Testtest parses the solid4.txt which consists of 3 polyhedrons. The
> parsing is correct but something goes wrong when i put the variables into
> the costructor.
>
> The polyhedron class generates a polyhedron shape(See attached file:
> Texttest.java)(See attached file: solid4.txt)(See attached file:
> Polyhedron.java)
>
>
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to