Ele está rodando bem no MyIE, no entanto no IE ele apresenta aquele erro… veja o código:
public void init()
{
setLayout(null);
setSize(586, 153);
panel1 = new Panel();
panel1.setLayout(null);
panel1.setBounds(0, 0, 588, 156);
panel1.setForeground(new Color(0xffffff));
panel1.setBackground(new Color(0));
add(panel1);
choice1 = new Choice();
choice1.addItem("Cylinder");
choice1.addItem("Sphere");
choice1.addItem("Cube");
choice1.addItem("Cone");
panel1.add(choice1);
choice1.setBounds(136, 33, 100, 20);
choice1.setFont(new Font("Dialog", 0, 12));
choice1.setForeground(new Color(0));
choice1.setBackground(new Color(0xffffff));
button1 = new Button();
button1.setActionCommand("button");
button1.setLabel("Y1 Color");
button1.setBounds(244, 35, 90, 20);
button1.setForeground(new Color(0));
button1.setBackground(new Color(0xc0c0c0));
panel1.add(button1);
textField1 = new TextField();
textField1.setText("0.4");
textField1.setBounds(340, 35, 40, 20);
textField1.setForeground(new Color(0));
textField1.setBackground(new Color(0xffffff));
panel1.add(textField1);
textField2 = new TextField();
textField2.setText("-0.2");
textField2.setBounds(388, 35, 40, 20);
textField2.setForeground(new Color(0));
textField2.setBackground(new Color(0xffffff));
panel1.add(textField2);
textField3 = new TextField();
textField3.setText("0.6");
textField3.setBounds(436, 35, 40, 20);
textField3.setForeground(new Color(0));
textField3.setBackground(new Color(0xffffff));
panel1.add(textField3);
textField4 = new TextField();
textField4.setText("0.4");
textField4.setBounds(484, 35, 40, 20);
textField4.setForeground(new Color(0));
textField4.setBackground(new Color(0xffffff));
panel1.add(textField4);
textField5 = new TextField();
textField5.setText("0.2");
textField5.setBounds(532, 35, 40, 20);
textField5.setForeground(new Color(0));
textField5.setBackground(new Color(0xffffff));
panel1.add(textField5);
choice2 = new Choice();
choice2.addItem("Cylinder");
choice2.addItem("Sphere");
choice2.addItem("Cube");
choice2.addItem("Cone");
panel1.add(choice2);
choice2.setBounds(136, 57, 100, 20);
choice2.setFont(new Font("Dialog", 0, 12));
choice2.setForeground(new Color(0));
choice2.setBackground(new Color(0xffffff));
button2 = new Button();
button2.setActionCommand("button");
button2.setLabel("Y2 Color");
button2.setBounds(244, 60, 90, 20);
button2.setForeground(new Color(0));
button2.setBackground(new Color(0xc0c0c0));
panel1.add(button2);
textField6 = new TextField();
textField6.setText("0.6");
textField6.setBounds(340, 60, 40, 20);
textField6.setForeground(new Color(0));
textField6.setBackground(new Color(0xffffff));
panel1.add(textField6);
textField7 = new TextField();
textField7.setText("0.1");
textField7.setBounds(388, 60, 40, 20);
textField7.setForeground(new Color(0));
textField7.setBackground(new Color(0xffffff));
panel1.add(textField7);
textField8 = new TextField();
textField8.setText("1.0");
textField8.setBounds(436, 60, 40, 20);
textField8.setForeground(new Color(0));
textField8.setBackground(new Color(0xffffff));
panel1.add(textField8);
textField9 = new TextField();
textField9.setText("0.3");
textField9.setBounds(484, 60, 40, 20);
textField9.setForeground(new Color(0));
textField9.setBackground(new Color(0xffffff));
panel1.add(textField9);
textField10 = new TextField();
textField10.setText("0.6");
textField10.setBounds(532, 60, 40, 20);
textField10.setForeground(new Color(0));
textField10.setBackground(new Color(0xffffff));
panel1.add(textField10);
choice3 = new Choice();
choice3.addItem("Cylinder");
choice3.addItem("Sphere");
choice3.addItem("Cube");
choice3.addItem("Cone");
panel1.add(choice3);
choice3.setBounds(136, 81, 100, 20);
choice3.setFont(new Font("Dialog", 0, 12));
choice3.setForeground(new Color(0));
choice3.setBackground(new Color(0xffffff));
button3 = new Button();
button3.setActionCommand("button");
button3.setLabel("Y3 Color");
button3.setBounds(244, 85, 90, 20);
button3.setForeground(new Color(0));
button3.setBackground(new Color(0xc0c0c0));
panel1.add(button3);
textField11 = new TextField();
textField11.setText("1.2");
textField11.setBounds(340, 85, 40, 20);
textField11.setForeground(new Color(0));
textField11.setBackground(new Color(0xffffff));
panel1.add(textField11);
textField12 = new TextField();
textField12.setText("1.0");
textField12.setBounds(388, 85, 40, 20);
textField12.setForeground(new Color(0));
textField12.setBackground(new Color(0xffffff));
panel1.add(textField12);
textField13 = new TextField();
textField13.setText("1.5");
textField13.setBounds(436, 85, 40, 20);
textField13.setForeground(new Color(0));
textField13.setBackground(new Color(0xffffff));
panel1.add(textField13);
textField14 = new TextField();
textField14.setText("1.2");
textField14.setBounds(484, 85, 40, 20);
textField14.setForeground(new Color(0));
textField14.setBackground(new Color(0xffffff));
panel1.add(textField14);
textField15 = new TextField();
textField15.setText("0.8");
textField15.setBounds(532, 85, 40, 20);
textField15.setForeground(new Color(0));
textField15.setBackground(new Color(0xffffff));
panel1.add(textField15);
textField16 = new TextField();
textField16.setText("0.0");
textField16.setBounds(340, 111, 88, 20);
textField16.setForeground(new Color(0));
textField16.setBackground(new Color(0xffffff));
panel1.add(textField16);
label1 = new Label("Y1");
label1.setBounds(120, 33, 15, 20);
panel1.add(label1);
label2 = new Label("Y2");
label2.setBounds(120, 57, 15, 20);
panel1.add(label2);
label3 = new Label("Y3");
label3.setBounds(120, 81, 15, 20);
panel1.add(label3);
label4 = new Label("X1");
label4.setBounds(354, 12, 15, 20);
panel1.add(label4);
label5 = new Label("X2");
label5.setBounds(400, 12, 15, 20);
panel1.add(label5);
label6 = new Label("X3");
label6.setBounds(447, 12, 15, 20);
panel1.add(label6);
label7 = new Label("X4");
label7.setBounds(495, 12, 15, 20);
panel1.add(label7);
label8 = new Label("X5");
label8.setBounds(543, 12, 15, 20);
panel1.add(label8);
label9 = new Label("Cursor Position");
label9.setBounds(246, 108, 92, 20);
panel1.add(label9);
label10 = new Label("Bar Shape");
label10.setBounds(156, 12, 84, 20);
panel1.add(label10);
label11 = new Label("Color");
label11.setBounds(274, 12, 38, 20);
panel1.add(label11);
label12 = new Label("Graph Type");
label12.setBounds(24, 12, 84, 20);
panel1.add(label12);
choice4 = new Choice();
choice4.addItem("Bar");
choice4.addItem("Line");
choice4.addItem("Elevation Grid");
panel1.add(choice4);
choice4.setBounds(12, 33, 100, 20);
choice4.setFont(new Font("Dialog", 0, 12));
choice4.setForeground(new Color(0));
choice4.setBackground(new Color(0xffffff));
//JSObject jsobject = JSObject.getWindow(this);
//JSObject jsobject1 = (JSObject)jsobject.getMember("document");
//JSObject jsobject2 = (JSObject)jsobject1.getMember("embeds");
//browser = (Browser)jsobject2.getSlot(0);
browser = Browser.getBrowser(this);
try
{
material0 = browser.getNode("ShpCol0");
material1 = browser.getNode("ShpCol1");
material2 = browser.getNode("ShpCol2");
material3 = browser.getNode("LC1");
material4 = browser.getNode("LC2");
material5 = browser.getNode("LC3");
choice_0 = browser.getNode("Shp0");
choice_1 = browser.getNode("Shp1");
choice_2 = browser.getNode("Shp2");
choice_3 = browser.getNode("graphType");
transform01 = browser.getNode("C01");
transform02 = browser.getNode("C02");
transform03 = browser.getNode("C03");
transform04 = browser.getNode("C04");
transform05 = browser.getNode("C05");
transform11 = browser.getNode("C11");
transform12 = browser.getNode("C12");
transform13 = browser.getNode("C13");
transform14 = browser.getNode("C14");
transform15 = browser.getNode("C15");
transform21 = browser.getNode("C21");
transform22 = browser.getNode("C22");
transform23 = browser.getNode("C23");
transform24 = browser.getNode("C24");
transform25 = browser.getNode("C25");
extrusion1 = browser.getNode("SP1");
extrusion2 = browser.getNode("SP2");
extrusion3 = browser.getNode("SP3");
elevationGrid1 = browser.getNode("H");
color1 = browser.getNode("VertexColor");
diffuseColor0 = (EventInSFColor)material0.getEventIn("set_diffuseColor");
diffuseColor1 = (EventInSFColor)material1.getEventIn("set_diffuseColor");
diffuseColor2 = (EventInSFColor)material2.getEventIn("set_diffuseColor");
diffuseColor3 = (EventInSFColor)material3.getEventIn("set_diffuseColor");
diffuseColor4 = (EventInSFColor)material4.getEventIn("set_diffuseColor");
diffuseColor5 = (EventInSFColor)material5.getEventIn("set_diffuseColor");
whichChoice0 = (EventInSFInt32)choice_0.getEventIn("set_whichChoice");
whichChoice1 = (EventInSFInt32)choice_1.getEventIn("set_whichChoice");
whichChoice2 = (EventInSFInt32)choice_2.getEventIn("set_whichChoice");
whichChoice3 = (EventInSFInt32)choice_3.getEventIn("set_whichChoice");
scale01 = (EventInSFVec3f)transform01.getEventIn("set_scale");
scale02 = (EventInSFVec3f)transform02.getEventIn("set_scale");
scale03 = (EventInSFVec3f)transform03.getEventIn("set_scale");
scale04 = (EventInSFVec3f)transform04.getEventIn("set_scale");
scale05 = (EventInSFVec3f)transform05.getEventIn("set_scale");
scale11 = (EventInSFVec3f)transform11.getEventIn("set_scale");
scale12 = (EventInSFVec3f)transform12.getEventIn("set_scale");
scale13 = (EventInSFVec3f)transform13.getEventIn("set_scale");
scale14 = (EventInSFVec3f)transform14.getEventIn("set_scale");
scale15 = (EventInSFVec3f)transform15.getEventIn("set_scale");
scale21 = (EventInSFVec3f)transform21.getEventIn("set_scale");
scale22 = (EventInSFVec3f)transform22.getEventIn("set_scale");
scale23 = (EventInSFVec3f)transform23.getEventIn("set_scale");
scale24 = (EventInSFVec3f)transform24.getEventIn("set_scale");
scale25 = (EventInSFVec3f)transform25.getEventIn("set_scale");
rotation01 = (EventInSFRotation)transform01.getEventIn("set_rotation");
rotation02 = (EventInSFRotation)transform02.getEventIn("set_rotation");
rotation03 = (EventInSFRotation)transform03.getEventIn("set_rotation");
rotation04 = (EventInSFRotation)transform04.getEventIn("set_rotation");
rotation05 = (EventInSFRotation)transform05.getEventIn("set_rotation");
rotation11 = (EventInSFRotation)transform11.getEventIn("set_rotation");
rotation12 = (EventInSFRotation)transform12.getEventIn("set_rotation");
rotation13 = (EventInSFRotation)transform13.getEventIn("set_rotation");
rotation14 = (EventInSFRotation)transform14.getEventIn("set_rotation");
rotation15 = (EventInSFRotation)transform15.getEventIn("set_rotation");
rotation21 = (EventInSFRotation)transform21.getEventIn("set_rotation");
rotation22 = (EventInSFRotation)transform22.getEventIn("set_rotation");
rotation23 = (EventInSFRotation)transform23.getEventIn("set_rotation");
rotation24 = (EventInSFRotation)transform24.getEventIn("set_rotation");
rotation25 = (EventInSFRotation)transform25.getEventIn("set_rotation");
spine1 = (EventInMFVec3f)extrusion1.getEventIn("set_spine");
spine2 = (EventInMFVec3f)extrusion2.getEventIn("set_spine");
spine3 = (EventInMFVec3f)extrusion3.getEventIn("set_spine");
height1 = (EventInMFFloat)elevationGrid1.getEventIn("set_height");
colorV = (EventInMFColor)color1.getEventIn("set_color");
Node node = browser.getNode("Cursor");
outputTranslation = (EventOutSFVec3f)node.getEventOut("translation");
outputTranslation.advise(this, new Integer(2));
position = (EventInSFVec3f)node.getEventIn("set_translation");
return;
}
catch(InvalidNodeException invalidnodeexception)
{
add(new TextField("Failed to get node:" + invalidnodeexception));
error = true;
return;
}
catch(InvalidEventOutException invalideventoutexception)
{
add(new TextField("Failed to get EventOut:" + invalideventoutexception));
}
error = true;
}
public void callback(EventOut eventout, double d, Object obj)
{
float af[] = outputTranslation.getValue();
textField16.setText(String.valueOf(af[1] / 2.0F));
}
public boolean action(Event event, Object obj)
{
if(event.target instanceof TextField)
{
display();
float af[] = new float[3];
af[0] = 0.0F;
af[1] = Float.valueOf(textField16.getText()).floatValue() * 2.0F;
af[2] = 0.0F;
position.setValue(af);
return true;
}
if(event.target instanceof Choice)
{
int i = choice1.getSelectedIndex();
whichChoice0.setValue(i);
int j = choice2.getSelectedIndex();
whichChoice1.setValue(j);
int k = choice3.getSelectedIndex();
whichChoice2.setValue(k);
int l = choice4.getSelectedIndex();
whichChoice3.setValue(l);
display();
return true;
}
if(event.target instanceof Button)
{
if("Y1 Color".equals(obj))
{
float af1[] = new float[3];
af1[0] = (float)Math.random();
af1[1] = (float)Math.random();
af1[2] = (float)Math.random();
diffuseColor0.setValue(af1);
diffuseColor3.setValue(af1);
}
if("Y2 Color".equals(obj))
{
float af2[] = new float[3];
af2[0] = (float)Math.random();
af2[1] = (float)Math.random();
af2[2] = (float)Math.random();
diffuseColor1.setValue(af2);
diffuseColor4.setValue(af2);
}
if("Y3 Color".equals(obj))
{
float af3[] = new float[3];
af3[0] = (float)Math.random();
af3[1] = (float)Math.random();
af3[2] = (float)Math.random();
diffuseColor2.setValue(af3);
diffuseColor5.setValue(af3);
}
return true;
} else
{
return false;
}
}
public void display()
{
float af[][] = new float[3][5];
int i = choice4.getSelectedIndex();
af[0][0] = Float.valueOf(textField1.getText()).floatValue();
af[0][1] = Float.valueOf(textField2.getText()).floatValue();
af[0][2] = Float.valueOf(textField3.getText()).floatValue();
af[0][3] = Float.valueOf(textField4.getText()).floatValue();
af[0][4] = Float.valueOf(textField5.getText()).floatValue();
af[1][0] = Float.valueOf(textField6.getText()).floatValue();
af[1][1] = Float.valueOf(textField7.getText()).floatValue();
af[1][2] = Float.valueOf(textField8.getText()).floatValue();
af[1][3] = Float.valueOf(textField9.getText()).floatValue();
af[1][4] = Float.valueOf(textField10.getText()).floatValue();
af[2][0] = Float.valueOf(textField11.getText()).floatValue();
af[2][1] = Float.valueOf(textField12.getText()).floatValue();
af[2][2] = Float.valueOf(textField13.getText()).floatValue();
af[2][3] = Float.valueOf(textField14.getText()).floatValue();
af[2][4] = Float.valueOf(textField15.getText()).floatValue();
if(i == 0)
bar(af);
if(i == 1)
line(af);
if(i == 2)
grid(af);
}
public void line(float af[][])
{
float af1[][][] = new float[3][5][3];
for(int i = 0; i < 3; i++)
{
af1[i][0][0] = -2F;
af1[i][1][0] = -1F;
af1[i][2][0] = 0.0F;
af1[i][3][0] = 1.0F;
af1[i][4][0] = 2.0F;
af1[i][0][1] = af[i][0];
af1[i][1][1] = af[i][1];
af1[i][2][1] = af[i][2];
af1[i][3][1] = af[i][3];
af1[i][4][1] = af[i][4];
af1[i][0][2] = 0.0F;
af1[i][1][2] = 0.0F;
af1[i][2][2] = 0.0F;
af1[i][3][2] = 0.0F;
af1[i][4][2] = 0.0F;
}
spine1.setValue(af1[0]);
spine2.setValue(af1[1]);
spine3.setValue(af1[2]);
}
public void grid(float af[][])
{
float af1[] = new float[15];
for(int i = 0; i < 5; i++)
{
af1[i] = af[2][i];
af1[i + 5] = af[1][i];
af1[i + 10] = af[0][i];
}
height1.setValue(af1);
}
public void bar(float af[][])
{
float af1[][][] = new float[3][5][3];
float af2[][][] = new float[3][5][4];
for(int i = 0; i < 3; i++)
{
for(int j = 0; j < 5; j++)
{
af1[i][j][0] = 0.35F;
af1[i][j][1] = 0.35F;
af1[i][j][2] = 0.35F;
af2[i][j][0] = 1.0F;
af2[i][j][1] = 0.0F;
af2[i][j][2] = 0.0F;
af2[i][j][3] = 0.0F;
if(af[i][j] == 0.0F)
af[i][j] = 0.0001F;
af1[i][j][1] = Math.abs(af[i][j]);
if(af[i][j] < 0.0F)
af2[i][j][3] = 3.14F;
}
}
rotation01.setValue(af2[0][0]);
scale01.setValue(af1[0][0]);
rotation02.setValue(af2[0][1]);
scale02.setValue(af1[0][1]);
rotation03.setValue(af2[0][2]);
scale03.setValue(af1[0][2]);
rotation04.setValue(af2[0][3]);
scale04.setValue(af1[0][3]);
rotation05.setValue(af2[0][4]);
scale05.setValue(af1[0][4]);
rotation11.setValue(af2[1][0]);
scale11.setValue(af1[1][0]);
rotation12.setValue(af2[1][1]);
scale12.setValue(af1[1][1]);
rotation13.setValue(af2[1][2]);
scale13.setValue(af1[1][2]);
rotation14.setValue(af2[1][3]);
scale14.setValue(af1[1][3]);
rotation15.setValue(af2[1][4]);
scale15.setValue(af1[1][4]);
rotation21.setValue(af2[2][0]);
scale21.setValue(af1[2][0]);
rotation22.setValue(af2[2][1]);
scale22.setValue(af1[2][1]);
rotation23.setValue(af2[2][2]);
scale23.setValue(af1[2][2]);
rotation24.setValue(af2[2][3]);
scale24.setValue(af1[2][3]);
rotation25.setValue(af2[2][4]);
scale25.setValue(af1[2][4]);
}
public Graph()
{
error = false;
}
Browser browser;
Node slider;
EventInSFVec3f position;
EventOutSFVec3f outputTranslation;
Node material0;
Node material1;
Node material2;
Node material3;
Node material4;
Node material5;
Node choice_0;
Node choice_1;
Node choice_2;
Node choice_3;
Node transform01;
Node transform02;
Node transform03;
Node transform04;
Node transform05;
Node transform11;
Node transform12;
Node transform13;
Node transform14;
Node transform15;
Node transform21;
Node transform22;
Node transform23;
Node transform24;
Node transform25;
Node extrusion1;
Node extrusion2;
Node extrusion3;
Node elevationGrid1;
Node color1;
EventInSFColor diffuseColor0;
EventInSFColor diffuseColor1;
EventInSFColor diffuseColor2;
EventInSFColor diffuseColor3;
EventInSFColor diffuseColor4;
EventInSFColor diffuseColor5;
EventInSFInt32 whichChoice0;
EventInSFInt32 whichChoice1;
EventInSFInt32 whichChoice2;
EventInSFInt32 whichChoice3;
EventInSFVec3f scale01;
EventInSFVec3f scale02;
EventInSFVec3f scale03;
EventInSFVec3f scale04;
EventInSFVec3f scale05;
EventInSFVec3f scale11;
EventInSFVec3f scale12;
EventInSFVec3f scale13;
EventInSFVec3f scale14;
EventInSFVec3f scale15;
EventInSFVec3f scale21;
EventInSFVec3f scale22;
EventInSFVec3f scale23;
EventInSFVec3f scale24;
EventInSFVec3f scale25;
EventInSFRotation rotation01;
EventInSFRotation rotation02;
EventInSFRotation rotation03;
EventInSFRotation rotation04;
EventInSFRotation rotation05;
EventInSFRotation rotation11;
EventInSFRotation rotation12;
EventInSFRotation rotation13;
EventInSFRotation rotation14;
EventInSFRotation rotation15;
EventInSFRotation rotation21;
EventInSFRotation rotation22;
EventInSFRotation rotation23;
EventInSFRotation rotation24;
EventInSFRotation rotation25;
EventInMFVec3f spine1;
EventInMFVec3f spine2;
EventInMFVec3f spine3;
EventInMFFloat height1;
EventInMFColor colorV;
boolean error;
Panel panel1;
Choice choice1;
Button button1;
TextField textField1;
TextField textField2;
TextField textField3;
TextField textField4;
TextField textField5;
Choice choice2;
Button button2;
TextField textField6;
TextField textField7;
TextField textField8;
TextField textField9;
TextField textField10;
Choice choice3;
Button button3;
TextField textField11;
TextField textField12;
TextField textField13;
TextField textField14;
TextField textField15;
TextField textField16;
Label label1;
Label label2;
Label label3;
Label label4;
Label label5;
Label label6;
Label label7;
Label label8;
Label label9;
Label label10;
Label label11;
Label label12;
Choice choice4;