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
Posted by peter on May 12, 2007 at 05:25 AM PDT #
peter, sorry to hear that. I'm using NVidia on Ubuntu 7.04 without any problems (knock on wood).
Posted by Geertjan on May 12, 2007 at 11:47 AM PDT #
http://blogs.sun.com/geertjan/entry/hello_nasa_world_wind
NASA World Wind的worldwind.jar已经正式发布, 下面我们来看一些最简单的 例子,这些例子都可以在NetBeans中快速和敏捷地实现。
Posted by Classicning Clog on May 12, 2007 at 11:24 PM PDT #
Posted by Orlando Warren on May 13, 2007 at 10:37 PM PDT #
Posted by Geertjan on May 14, 2007 at 06:03 AM PDT #
Posted by Geertjan on May 14, 2007 at 06:34 AM PDT #
Posted by Orlando Warren on May 14, 2007 at 03:19 PM PDT #
Posted by Geertjan on May 14, 2007 at 04:49 PM PDT #
Posted by Geertjan on May 14, 2007 at 05:02 PM PDT #
Posted by 72.47.27.140 on May 15, 2007 at 08:05 AM PDT #
Posted by vincecrue on May 17, 2007 at 09:59 AM PDT #
Posted by Mario on May 19, 2007 at 11:21 AM PDT #
i also have the same problem as Mario.. bith worldwind 1.4 and the basic demo that comes with WW java jdk works fine but when i follow all the steps mentioned above all i get is a black screen with dots and only dots.. can you please suggest what the problem might be?
Posted by luigi on October 30, 2007 at 09:54 AM PDT #
I think it is best to write to nbusers@netbeans.org with this question.
Posted by Geertjan on October 30, 2007 at 09:58 AM PDT #
Are you using Netbeans 5.5.1 in this turorial? I am having problems too with this, I emailed netbeans.org about the problem and they have no idea.
When you say create a helper class, do you mean create a new "java class" with the name of "WWHelper"? Because I cannot find anything that refers to a helper class.
Posted by Kevin on January 01, 2008 at 10:15 AM PST #
Yes, just a normal Java class.
Posted by Geertjan on January 01, 2008 at 10:23 AM PST #
Here is the error im getting:
init:
deps-jar:
Created dir: /home/kevin/WWJTEST/build/classes
Compiling 3 source files to /home/kevin/WWJTEST/build/classes
/home/kevin/WWJTEST/src/wwjtest/WWHelper.java:21: cannot find symbol
symbol : class WorldWindow
location: class wwjtest.WWHelper
public static void setup(final WorldWindow ww) {
/home/kevin/WWJTEST/src/wwjtest/NewJFrame.java:18: cannot find symbol
symbol : variable worldWindowGLCanvas1
location: class wwjtest.NewJFrame
WWHelper.setup(worldWindowGLCanvas1);
/home/kevin/WWJTEST/src/wwjtest/WWHelper.java:22: cannot find symbol
symbol : class Model
location: class wwjtest.WWHelper
Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
/home/kevin/WWJTEST/src/wwjtest/WWHelper.java:22: cannot find symbol
symbol : class Model
location: class wwjtest.WWHelper
Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
/home/kevin/WWJTEST/src/wwjtest/WWHelper.java:22: cannot find symbol
symbol : variable AVKey
location: class wwjtest.WWHelper
Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
/home/kevin/WWJTEST/src/wwjtest/WWHelper.java:22: cannot find symbol
symbol : variable WorldWind
location: class wwjtest.WWHelper
Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
6 errors
BUILD FAILED (total time: 1 second)
Posted by Kevin on January 01, 2008 at 10:27 AM PST #
Here is the error im getting:
init:
deps-jar:
Created dir: /home/kevin/WWJTEST/build/classes
Compiling 3 source files to /home/kevin/WWJTEST/build/classes
/home/kevin/WWJTEST/src/wwjtest/WWHelper.java:21: cannot find symbol
symbol : class WorldWindow
location: class wwjtest.WWHelper
public static void setup(final WorldWindow ww) {
/home/kevin/WWJTEST/src/wwjtest/NewJFrame.java:18: cannot find symbol
symbol : variable worldWindowGLCanvas1
location: class wwjtest.NewJFrame
WWHelper.setup(worldWindowGLCanvas1);
/home/kevin/WWJTEST/src/wwjtest/WWHelper.java:22: cannot find symbol
symbol : class Model
location: class wwjtest.WWHelper
Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
/home/kevin/WWJTEST/src/wwjtest/WWHelper.java:22: cannot find symbol
symbol : class Model
location: class wwjtest.WWHelper
Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
/home/kevin/WWJTEST/src/wwjtest/WWHelper.java:22: cannot find symbol
symbol : variable AVKey
location: class wwjtest.WWHelper
Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
/home/kevin/WWJTEST/src/wwjtest/WWHelper.java:22: cannot find symbol
symbol : variable WorldWind
location: class wwjtest.WWHelper
Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
6 errors
BUILD FAILED (total time: 1 second)
Posted by Kevin on January 01, 2008 at 11:36 AM PST #
sorry about the double post, it said comment authentication failed.
Posted by kevin on January 01, 2008 at 11:37 AM PST #
i created two files by the name of
WWTopComponent.java - containing code for JForm, and
WWHelper.java - containing code for Helper class
this was the error i got after running the project:
init:
deps-jar:
compile:
run:
java.lang.NoClassDefFoundError: wind
Exception in thread "main"
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
on further checking, i found the following errors in the private initComponents() - generated by the Form Editor
cannot find symbol
symbol: method add(gov.nasa.worldwind.awt.WorldWindowGLCanvas,int,int,short)
location: class org.jdesktop.layout.GroupLayout.SequentialGroup
cannot find symbol
symbol: method addContainerGap()
location: class org.jdesktop.layout.GroupLayout.SequentialGroup.add
PLEASE HELP!!!!!
Posted by utkarsh on May 14, 2008 at 09:41 PM PDT #
I followed all the steps and get it to run except that it does not zoom or pan. Am I missing something?
Posted by khaled on November 06, 2008 at 06:01 PM PST #
Just came across this nice tutorial. I do have WWJ working within NetBeans, however, I am unable to successfully launch it as an applet in my web application. I get series of link errors. I moved the native dlls to my JRE installation lib/ext folder, included them within my webapp directory..but, no luck.
Kindly let me know any suggestions,
Thanks, Suma.
Posted by Suma on November 25, 2008 at 02:02 PM PST #
My Netbeans 6.5 JFrame initComponemts()
The .addComponent(..) and
the .addContainerGap(...)
are giving errors of "cannot find symbol"
Any ideas.
mark
private void initComponents() {
worldWindowGLCanvas1 = new gov.nasa.worldwind.awt.WorldWindowGLCanvas();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(worldWindowGLCanvas1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(worldWindowGLCanvas1, javax.swing.GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>
Posted by Mark Young on February 18, 2009 at 06:46 AM PST #
Hi,
I may sound a bit out of context but it is related. Could anyone enlighten on the best 3D library for Netbeans platform applications. I have had problems with GLJPanel of JOGL on my Ubuntu Box.
Regards,
Sanat
Posted by Sanat on March 17, 2009 at 08:02 AM PDT #
Mark,
Did you ever resolve that issue? I am running into that same problem using NetBeans 6.5
Posted by green on July 10, 2009 at 01:21 PM PDT #
Has anyone else gotten
SEVERE: Exception while attempting to repaint WorldWindow
java.lang.NullPointerException
Posted by jayp on September 02, 2009 at 11:45 AM PDT #
mark n green,
I too got the same 'symbol not found' with addcomponent am using NeBeans6.7.1
how to resolve it?
thanks
Posted by sam22 on September 02, 2009 at 01:15 PM PDT #
I was able to resolve the issue pls follow the below link
http://forum.worldwindcentral.com/showthread.php?p=73862
Posted by sam22 on September 04, 2009 at 09:20 AM PDT #


