Importing / using locators (sorry newbie question)

Hi guys,



I recently downloaded the JME3 alpha 4 SDK and I’m going through the tutorials.

In the HelloAssets tutorial, there is an exercice in which I am supposed to use the ZipLocator to load assets from the town.zip file. Here is the code from the tutorial:

assetManager.registerLocator(“town.zip”, ZipLocator.class.getName());

Spatial scene = assetManager.loadModel(“main.scene”);

rootNode.attachChild(scene);



Somehow, I have to import the com.jme3.asset package. Unfortunately, I’m also unfamiliar with Java. I’m an experienced C# and Delphi developper, but I want to learn Java too, and making a game with Java seems a fun way to learn Java (that’s what I did to learn C# a while back).



Anyway, back to the problem at hand: I can’t find this package or Jar file, or where ever these locator classes are implemented.

I added an import to my project to load the package (not explained in the tutorial):

import com.jme3.asset.plugins;

But sure enough, I get a message: cannot find symbol



I searched around in the jmonkeyplatform folders to find this assets/plugins package, but I couldn’t find anything. I didn’t find it as a separately downloadable package on the website either. I couldn’t find a forum post for this same problem: so I guess it might be a problem with the alpha 4 not containing this package, or me being completely clueless (option 2 is most likely).



Can anyone give me pointers on how to import/use the locators?



Thanks a lot!

sigh Okay, I found it. I had to specify my import like this: import com.jme3.asset.plugins.ZipLocator;

Sorry to clog the forums with stupid newbie questions… :S

1 Like

If you are using JMP/SDK then ctrl-shift-i will attempt to auto-fix your imports for you.

1 Like

Oh, good to know! I wasn’t aware of this feature. Thanks pspeed.

pspeed said:
If you are using JMP/SDK then ctrl-shift-i will attempt to auto-fix your imports for you.


yeh thanks! after you said this i did a bit more research looking for more, ctrl + space seems to do a lot of useful things as well:
http://netbeans.org/kb/docs/java/editor-codereference.html

also i use ctrl + alt + f (formats code for you) a lot

Those are the thee I probably use most :wink:

Note that you can do whole for loops etc when you write for[Ctrl-Space]… It even recognizes list variables and uses them automatically in the loop etc.