Exception in thread "main" java.lang.Error: Unreso
Publicado por Jacobo (2 intervenciones) el 13/01/2008 16:57:06
Hola,
estoy intentando ejecutar una API entre Java y VRML, ésta debería ejecutar una serie de instrucciones en Java, para efectuar una serie de acciones en unos diseños con VRML.Éstos son los códigos:
Hay un Main que llama a unas funciones(para que cambie de color una bolita diseñada en VRML):
A)
package changeColor;
import vrml.*;
import vrml.field.*;
import vrml.node.*;
public class Main {
public static void main (String args[]) {
ChangeColor c = new ChangeColor();
c.initialize();
}
}
B)
package changeColor;
import vrml.*;
import vrml.field.*;
import vrml.node.*;
public class ChangeColor extends Script {
private SFBool on; // status of on-off
float red[] = { 1, 0, 0 }; // RGB(Red)
float blue[] = { 0, 0, 1 }; // RGB(Blue)
private SFColor newColor ;
public void initialize() {
newColor = (SFColor) getEventOut("newColor");
on = (SFBool) getField("on");
}
public void processEvent(Event e) {
ConstSFBool v = (ConstSFBool)e.getValue();
if(v.getValue()){
if (on.getValue()) {
newColor.setValue(red); // set red to 'newColor'
} else {
newColor.setValue(blue); // set blue to 'newColor'
}
on.setValue(!on.getValue()); // = !on.getValue();
} }
/* public static void main (String args[]) {
initialize();
}*/
}
Estoy usando Eclipse , y al ejecutar me da el siguiente fallo:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at changeColor.Main.main(Main.java:9)
Agradecería enormemente si alguen conoce la causa del fallo, igual es poco cosa, pero tengo que familiarizarme más con Java.
Gracias
estoy intentando ejecutar una API entre Java y VRML, ésta debería ejecutar una serie de instrucciones en Java, para efectuar una serie de acciones en unos diseños con VRML.Éstos son los códigos:
Hay un Main que llama a unas funciones(para que cambie de color una bolita diseñada en VRML):
A)
package changeColor;
import vrml.*;
import vrml.field.*;
import vrml.node.*;
public class Main {
public static void main (String args[]) {
ChangeColor c = new ChangeColor();
c.initialize();
}
}
B)
package changeColor;
import vrml.*;
import vrml.field.*;
import vrml.node.*;
public class ChangeColor extends Script {
private SFBool on; // status of on-off
float red[] = { 1, 0, 0 }; // RGB(Red)
float blue[] = { 0, 0, 1 }; // RGB(Blue)
private SFColor newColor ;
public void initialize() {
newColor = (SFColor) getEventOut("newColor");
on = (SFBool) getField("on");
}
public void processEvent(Event e) {
ConstSFBool v = (ConstSFBool)e.getValue();
if(v.getValue()){
if (on.getValue()) {
newColor.setValue(red); // set red to 'newColor'
} else {
newColor.setValue(blue); // set blue to 'newColor'
}
on.setValue(!on.getValue()); // = !on.getValue();
} }
/* public static void main (String args[]) {
initialize();
}*/
}
Estoy usando Eclipse , y al ejecutar me da el siguiente fallo:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at changeColor.Main.main(Main.java:9)
Agradecería enormemente si alguen conoce la causa del fallo, igual es poco cosa, pero tengo que familiarizarme más con Java.
Gracias
Valora esta pregunta


0