Importting a model

[java]
private String loader(String message){
JFileChooser fileopen = new JFileChooser(“.”);
fileopen.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int ret = fileopen.showDialog(null,message);
if (ret == JFileChooser.APPROVE_OPTION) {
File file = fileopen.getSelectedFile();
return file.toString();
}

    return "";
}     



private void load(){
    String userHome = loader("Load from...");
    if (userHome == "") {
        return;
    }
    assetManager.registerLocator("", FileLocator.class);
    floor = (Node)assetManager.loadModel(userHome+"\\floor.j3o");
    shapes = (Node)assetManager.loadModel(userHome+"\\shapes.j3o");
} <blockquote></blockquote> 

[/java]

But although th efiles floor.j3o and shpaes j3o exist for sure (checkd 5 time ) in th efolder im choosing , i still get an asset not found Exception :-\

https://dl.dropboxusercontent.com/u/32577213/bug.jpg

Any ideas on what can i do ?

SOlved by changing the line :

[java]
assetManager.registerLocator(“”, FileLocator.class);
floor = (Node)assetManager.loadModel(userHome+”\floor.j3o”);
shapes = (Node)assetManager.loadModel(userHome+”\shapes.j3o”);
[/java]

to

[java]
assetManager.registerLocator(userHome, FileLocator.class);
floor = (Node)assetManager.loadModel(”\floor.j3o”);
shapes = (Node)assetManager.loadModel(”\shapes.j3o”);
[/java]

i think your general prolbem is your backwards \ in java you generally only! use forwards.

Asside from that make sure to enque the attaching of this so loaded models, as the load model runs not in the jme thread but the swing edt one.