Saturday May 12, 2007
Hello NASA World Wind
Now that the worldwind.jar for NASA World Wind is available, here's the absolutely simplest scenario that you can implement very quickly and efficiently with NetBeans IDE:
- Download and unzip the World Wind Java SDK.
- In NetBeans IDE, select Tools / Palette Manager from the main menu. In the Swing/AWT Components Palette Manager, browse to the worldwind.jar. Select WorldWindowGLCanvas component and add it to the Beans category.
- Create a new Java application in NetBeans IDE. Open the Project Properties dialog box. In the Libraries tab, put the worldwind.jar on the compile time classpath. Put jogl.jar and gluegen-rt.jar, which are both in the World Wind Java SDK you downloaded, on the runtime classpath.
- Again within the Project Properties dialog box, use the Run tab to add a line such as the following in the VM Options text field:
-Djava.library.path=/path/to/unzipped/nasa/download
- Create a JFrame in your application. Drag and drop the WorldWindowGLCanvas from the palette onto the JFrame and, if you like, resize to cover the whole JFrame, with this result:

- Create a helper class, with this very basic content:
public class WWHelper { private WWHelper() { } public static void setup(final WorldWindow ww) { Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME); ww.setModel(m); } }Then, back in the JFrame, add this line after the initComponents(), in the constructor:
WWHelper.setup(worldWindowGLCanvas1);
- Run the application. Let the JFrame's constructor be the application's starting point. Here's what you should see:

Use the mouse, or your keyboard's alternative, for panning and zooming:

This is the start of a series of blog entries on this topic. And a NetBeans tutorial will follow, as well as related NetBeans modules, such as templates and so on. With thanks to Ken Russell for help and support.
In other news. Check out the NetBeans On The Road 2007 hometown contest. If you win, you'll find those dusty NetBeans delivery guys on your doorstep, fresh from their recent Palestinian adventures, as recorded on http://netbeans.tv. Could be pretty cool if you enter together with a bunch of other people, such as from your college or JUG, because from what I hear those guys like to party.
May 12 2007, 03:45:11 AM PDT Permalink


