| James Anderson 2005-07-06, 8:20 am |
| nunomartins01 wrote:
> private void Clicar(java.awt.event.MouseEvent evt) {
>
> textField1.setText("Textura Mudada");
>
> mat = mainScene.getNamedNode("MAT");
>
> MFString textura = (MFString) mat.getField("url");
>
> String[][] val=new String[1][1];
>
> val[0][0]= (String)"im.jpg";
>
> System.out.println(val[0][0]);
>
> textura.setValue(val[0][0]); <- ERROR
>
> }
Nuno,
MFString.setValue takes an argument of type String[], but your code is
giving it an argument of type String. (Since val is of type String[][],
val[0][0] is of type String.) Try this instead:
String[] val = {"im.jpg"};
textura.setValue(val);
Or neater still:
textura.setValue(new String[] {"im.jpg"});
The following should also work:
textura.set1Value(0, "im.jpg");
James
|