More on NASA World Wind and NetBeans IDE

In the screenshot below, notice that there's a status bar. The status bar shows the latitude, longitude and elevation of whatever is under the cursor on the globe. Also, what is very useful is that you get a red blinking "Downloading" text, whenever images are being downloaded to fill out the current view. Have a look at the status bar below, so you know what I'm talking about, before I reveal the most interesting part about it:

(By the way, notice how the image above is tilted! A simple function key combination allows that to happen. That's a really cool part of the NASA World Wind story, giving me a view from Prague to Stockholm, horizontally.) OK, now here is the interesting part: you can simply grab the status bar from the samples that accompany the NASA World Wind Java SDK. Two samples are provided, each making use of a class called Pop that class into your application and then append it to whatever panel you want to append it to. Even at this point you can copy and paste code from the samples. The stuff in bold below comes straight from the samples:

public NewJFrame() {
    StatusBar statusBar = new StatusBar();
    subPanel.add(statusBar, BorderLayout.PAGE_END);
    WWHelper.setup(jList1, worldWindowGLCanvas1);

Notice that the status bar is added to a panel that makes use of BorderLayout. Meanwhile, I'd prefer to use GroupLayout for the design of the main panel. Here's where the point of this blog comes together. I added a small panel below my main panel, as you can see here:

As a result, I am able to add the status bar to this panel, which uses BorderLayout, while I am still able to use GroupLayout on the main panel. Hurray.


Post a Comment:
  • HTML Syntax: NOT allowed

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« March 2015