Sunday Feb 02, 2014

RedMonk at FOSDEM: Lies, Damned Lies, and Statistics

Imagine you switch on the TV and you're just in time to catch the start of the weather report. The reporter is smiling cheerfully into the camera, while saying:

"We haven't been able to measure weather statistics in the whole country. In fact, we don't really know exactly how large the country is. Nevertheless, that being said, based on the weather statistics that we did manage to get hold of, here is the state of the weather today."

That, honestly, is what happened at FOSDEM yesterday in a packed out (people standing in the aisles, sitting on the floor, lined up outside in the corridor) RedMonk session entitled "What a Long Strange Trip It's Been: The Past, Present and Future of Java". (Here's the abstract.)

Now, Steve O'Grady was perfectly frank in saying exactly what he said (and says it again in his blog article), "to be included in this analysis, a language must be observable within both GitHub and Stack Overflow." And that's really all that's been analyzed, i.e., GitHub and Stack Overflow. (As a corollary, you then end up in the endlessly hilarious and inherently unresolvable discussion about what it means that there are many questions on Stack Overflow about a language -- (a) that it is popular, (b) that it is complicated, (c) that it is badly documented, (d) combinations of the above, (e) something else.) OK, so then I think the title "The RedMonk Programming Language Rankings: January 2014" is really too heavy for the analysis that's been done and the content it provides, especially since by their own admission they haven't surveyed closed-source corporate software development, nor have any clue about how to do so. I'd have thought they'd have built up a database of software companies around the world, that they've built relationships with these companies, and that thanks to the relationships they've developed they're able to regularly poll these companies on the software (and languages and frameworks and libraries and IDEs) they're using. However, this turns out to be quite clearly not the case at all.

And I don't think it's a credible defence to say, "hey, I told you that we didn't analyze anything other than GitHub and Stack Overflow" because a lot of organizations take the analysis of RedMonk (and similar organizations, such as Forrester, where the difference is you have to pay for the analysis results and you get an impressively authenticated PDF, rather than a free blog entry) very seriously, in the same way that the weather reporter saying "the weather today has been sunny with blue skies" is taken seriously, because no one reads the small print that says "hey, we really don't know how large the country is and we possibly haven't visited most of it". In the case of the weather report, that would be absurd and they wouldn't have a particularly strong basis to exist if they said that.

Personally, I have no reason to make this point other than a concern that we really do need usable and independent research to be done on the ubiquity of programming languages (and frameworks and libraries and IDEs), since the conclusions reached by RedMonk favor Java, which is my personal favorite language, the one I have been supporting and promoting for the past 10 years.

In other words, I have nothing to gain by calling RedMonk's bluff. (I'd argue that even if you call your own bluff, it's still bluff.) They reached a conclusion I would have wanted them to reach: Java is not only alive, it is vibrant, self-sustaining, used everywhere by everyone in all manner of application development. However, in a year or so, RedMonk may do another scan (or analysis or whatever) of GitHub and Stack Overflow and then come to completely different conclusions. And they would be as invalid and as silly to base any kind of conclusion on than the ones they have most recently come up with and were presented at FOSDEM yesterday:

OK, thanks, Java is very much alive and vibrant and is used for things other than enterprise applications. (Later that day I met up with John Kostaras from NATO, where they work on a massive Java desktop system that manages European air defence, which of course is yet another example of corporate work being done in Java that falls outside of RedMonk's research. In fact, if RedMonk were to research the ubiquity of Java desktop development, they'd say the Java desktop is dead, but only because NATO and all the other massive enterprises in the defence, aerospace, and banking domain don't use GitHub and Stack Overflow.) The call to action at the end was that we should spread the word that Java is alive. Great. Everyone except maybe analysts, who may have been scanning (or analyzing or whatever the verb is) some other repository somewhere and come up with contradictory conclusions, already knew that.

I'm sure I wasn't the only one left with the question marks outlined above, several of the discussions at the end of the session more or less asked the same thing, and the response was more or less the same, kind of along these lines: "Hey, we don't know how large the programming world is, we have no way of knowing that, we have to do the best we can with the data that we can get".

If that is really the case then, in the first place, I really appreciate the honesty. In the second place, however, I'd suggest that analysts start actually building relationships with companies and developers at companies, rather than with repositories and on-line discussion forums. In the third place, it's invalid to draw any broad conclusions from this analysis. The worst thing that one can do is to say, essentially, "yes, the weather statistics are incomplete and, what's worse, we have no clue how incomplete, nevertheless, that having been said, the skies are sunny and blue".

As a final point, the first photo above of the "packed out RedMonk session", (with people standing in the aisles, sitting on the floor, lined up outside in the corridor,) might indicate that there was a massive interest in the state of Java and especially in what RedMonk had to say about that, which might further underline (a) that Java is very popular and (b) that RedMonk is taken very seriously. Both those things may, of course, be true. But the photo doesn't prove that at all because... pretty much all the rooms at FOSDEM were "packed out". It's a free conference with a massive turnout and... surprisingly small rooms.

Saturday Feb 01, 2014

FOSDEM: Constantin Drabo from FasoJUG

The highlight of my trip to FOSDEM 2014 in Brussels was meeting Constantin Drabo for the first time, active in the NetCAT team for years, from Burkina Faso, where he set up the FasoJUG sometime ago.

Constantin is, aside from being a NetBeans fan, a Fedora fan. Above we're at the Fedora booth and between us is Jaroslav, the Fedora product manager.

It was great to meet you at last, Constantin!

Friday Jan 31, 2014

Awesome Blogs (Part 1):

I'm starting a new occasional series where I highlight awesome blogs around the webiverse.

And a great one, what a pleasure to kick the series off with this one, is the brand new by Brett Ryan, from Melbourne, Australia.

  • In Migrating to JDK 8 with NetBeans, his first blog entry, he shows how to set up and use NetBeans 8 to refactor applications to use JDK 8. It is well written, clear, has lots of screenshots, and is just a great read.

  • In The Power of the Arrow he shows 5 examples of code where he starts with a pre-Java 8 construct and then moves it step by step via NetBeans 8 to a new Java 8 lambdafied style, with all the intermediate steps included, and motivations why making the move makes sense.

And he says cool things about NetBeans 8, such as:

"I started doing these by hand and then slapped myself, NetBeans' hints can do all this for me. With NetBeans generally a hint will appear, you smile and accept it, possibly modify, then another hint might appear so you grin and accept that too; before you know it you've taken 5 or more lines down to 1."

I'm really looking forward to seeing what's next in Brett's blog!

Thursday Jan 30, 2014

YouTube: "Smart Migration to JDK 8"

Don't know where to start with JDK 8? Here's a complete kit of info getting you in the right frame of mind for upgrading your code to leverage the Java 8 language changes.

Feedback is welcome!

Wednesday Jan 29, 2014

Slides: "Smart Migration to JDK 8"

A new slide deck for a screencast I am working on, planning to publish it tomorrow, on how to effectively migrate to JDK 8. I.e., you simply must have tools to do so, otherwise it's a nightmare.

All the slides with "Demo" on them are the points where I will switch into NetBeans IDE 8 and do a small demo.

Probably a lot of the above will change quite a bit. 

The slideshare location is here:

On a related note, take a look at this brilliant new article by Brett Ryan on migrating with NetBeans 8 to JDK 8:

Tuesday Jan 28, 2014

YouTube: NetBeans 8 Loves PrimeFaces (Part 2)

I think the news for users of Java EE 7, PrimeFaces, and Maven, yesterday, was pretty cool. A complete CRUD application in PrimeFaces can be generated from your database.

However, there's more! (With NetBeans, there's always more.) Rather than generating a complete CRUD app, you might simply want to create a PrimeFaces data table for your backend. Forget all the CRUD features. Instead, you only want to create a data table that accesses your database via all the Java EE 7 specifications. How to do this without scratching your head?

Here's how:

Monday Jan 27, 2014

YouTube: NetBeans 8 Loves PrimeFaces (Part 1)

Do you have less than 5 minutes to spend learning something really cool? And the cool thing is that if Maven, Java EE 7, and PrimeFaces are in your toolbox, then definitely NetBeans 8 should be too! The evidence is below, in a YouTube clip of less than 5 minutes.

Saturday Jan 25, 2014

Ad Designer on the NetBeans Platform (Part 2)

I added some new features to the visual designer I mentioned a few days ago. Now there is automatic synchronization from the view to the source (not yet from the source to the view), as well as better checking about where the drop can take place, i.e., the "logo" can only be in the header, etc, as well as a drop image, if the item can be dropped.

Video speaks better than words:

Source code:

Even though it's got HTML in the name, it's simply a visual designer for XML files. After that, the idea is that the XML files get converted to HTML.

Friday Jan 24, 2014

Air Traffic Standards Award for Barco Orthogon with NetBeans

In the air traffic management (ATM) domain, System Wide Information Management (SWIM) is a new open standard-based information infrastructure which will connect all ATM stakeholders, aircraft as well as all ground facilities. In the recently held annual SWIM innovation contest, where innovations in software related to this domain are highlighted, Barco Orthogon won the top prize, in one of the two categories, namely "applications", with a NetBeans Platform solution.

So, here we have one of the leaders in the standards-oriented air traffic management domain heavily using Java as its language, the NetBeans Platform as its application framework, and NetBeans IDE as its development environment. 

Below you can see part of the solution that won Barco Orthogon the prize, i.e., these are screenshots of Barco Orthogon's ODS Open Platform based solutions, which in turn are based on the NetBeans Platform. The images demonstrate the effect of two different sets of color resources, one for a "day view" and the other a "night view". Barco Orthogon won for the enhancements it constructed on top of the SWIM standards. For example, the connecting lines in the timeline view between the flight strips and the time scales have different colors because they indicate a status of the arrival sequence planning to the air traffic controller. In the night view, blue means "pre-sequenced" (preliminarily planned), white is "free" to be changed by the controller, while grey is "frozen", that is, in the very last phase of approach, and cannot be changed any more.

Great work, Barco Orthogon team!

Thursday Jan 23, 2014

Ad Designer on the NetBeans Platform (Part 1)

Here's a new NetBeans Platform sample that puts many typical things together and gets you jump started when creating some kind of designer.

The movie above is silent. It shows how to create a new XML file of the type managed by the application. It shows you can drag items into certain regions of the visual designer, i.e., items in the Header category of the Palette can only be dropped in the top of the three widgets, items in the Body category only in the middle, etc. Then right-click anywhere to serialize into the XML file.

Source code:

Even though it's got HTML in the name, it's simply a visual designer for XML files. After that, the idea is that the XML files get converted to HTML.

Now see part 2.

Wednesday Jan 22, 2014

Excluding Proposals from Code Completion in NetBeans 8

Finding the place in the Options window where you can list the classes you'd like to exclude from the Code Completion box is not easy.

Therefore, in NetBeans 8, you can exclude the classes you don't need right from within the Code Completion box. Below, notice the lightbulb at the far right in the currently selected item in the Code Completion box, which appears the second time you call up code completion:

Press Alt-Enter or click the lightbulb and now you see this:

Press Enter and the item is excluded from the Code Completion box because it has now been added here for you, i.e., instead of going all the way here, the class was registered here for you when you pressed Enter above:

NetBeans 8. Making your coding life simpler all the time.

Tuesday Jan 21, 2014

NetBeans IDE 8 in One Screenshot

I believe this image to represent the essence of the key features of NetBeans IDE 8.

For more:

Monday Jan 20, 2014

Options Window Color Analysis

So you're happily using JTattoo in your NetBeans Platform application. However, when you use the darker variations, such as "com.jtattoo.plaf.graphite.GraphiteLookAndFeel", you run into a problem. Though all the colors change as you'd expect... there's still the white background at the top of the Options window, as you can see below. 

That may seem like a small and insignificant problem. However, in the real world, Java and the NetBeans Platform are to be found in air traffic management and air traffic control systems, where the possibility of switching between a "day view" and a "night view", with all the related color updates, is not a "nice to have", but a "must".

So, the pesky white bar at the top of the Options window is a real problem in these real scenarios. A glaring white background is the very last thing you want in the Options window when the traffic controller has switched to "night view".

How to fix it? First, run the application from NetBeans IDE in Debug mode, open the Options window, and then click the orange camera button in the toolbar. Now a snapshot is made of the Options window and rendered in NetBeans IDE, where you can click on anything in the snapshot and see its related properties, such as the name of the panel where that white background is defined:

Then dig into the source code and find that panel. You now find that "Tree.background" is the relevant UIManager color for the white background in the Options window:

private static Color getTabPanelBackground() {
    if( isMetal || isNimbus ) {
        Color res = UIManager.getColor( "Tree.background" ); //NOI18N
        if( null == res )
            res = Color.white;
        return new Color( res.getRGB() );
    return Color.white;

Switch into your @OnStart annotated Runnable and use "Tree.background" as shown below:

public class Startable implements Runnable {
    public void run() {
        try {
            UIManager.put("Tree.background", Color.LIGHT_GRAY);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Startable.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            Logger.getLogger(Startable.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            Logger.getLogger(Startable.class.getName()).log(Level.SEVERE, null, ex);
        } catch (UnsupportedLookAndFeelException ex) {
            Logger.getLogger(Startable.class.getName()).log(Level.SEVERE, null, ex);

And here's the Options window again, gone is the white background at the top:

Don't like the light gray color I set above? Fine, change it to another color. The point is that you now have control over that color and you also know how to figure out similar problems next time.

Sunday Jan 19, 2014

JTattoo and NetBeans Platform

A first attempt at JTattoo usage in a NetBeans Platform application.

To achieve the above, create a new module that wraps JTattoo, and in a different module set a dependency on the JTattoo module and then include the following:

public class Startable implements Runnable {
    public void run() {
        try {
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Startable.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            Logger.getLogger(Startable.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            Logger.getLogger(Startable.class.getName()).log(Level.SEVERE, null, ex);
        } catch (UnsupportedLookAndFeelException ex) {
            Logger.getLogger(Startable.class.getName()).log(Level.SEVERE, null, ex);


Any NetBeans Platform developers using JTattoo out there, would be great to hear your opinions on it, and any tips and tricks.

Saturday Jan 18, 2014

Width of JavaScript Code Completion Box in NetBeans IDE

One thing I don't like about doing JavaScript in NetBeans IDE is the very wide code completion box, see below. Doesn't even fit in this blog, it's so wide, nor in the browser when you enlarge it below, without scrolling.

In NetBeans IDE 8, there's a new option to configure the width of the code completion box for JavaScript. You can see it below, "Code Completion Item Signature Char Width", which is set to 40 by default, but I prefer 10:

And now the code completion box is much friendlier:

And check out the cool Phaser code completion:

Note: This code completion configuration option is not in NetBeans IDE 8 Beta. It was added after that was released. You'll need a nightly build or wait for the final NetBeans IDE 8 release.

Friday Jan 17, 2014

Simple Security Mechanism for the NetBeans Platform

If you want a simple security mechanism for the NetBeans Platform, go here: 

Run the attached from NetBeans IDE 7.4. If you're not logged in as 'admin', there's no Admin menu. Otherwise, there is.

The @OnStart, i.e., this is the new way of doing ModuleInstall classes, no need to register in the Manifest:

public class Startable implements Runnable {

    public void run() {
        NotifyDescriptor.InputLine nd = new NotifyDescriptor.InputLine("Name", "Login");
        //Got tired of typing it by hand:
        Object response = DialogDisplayer.getDefault().notify(nd);
        if (response == NotifyDescriptor.OK_OPTION) {
            String username = nd.getInputText();
            NotifyDescriptor.Message msg;
            if (username.equals("admin")) {
            } else {
                FileObject admin = FileUtil.getConfigFile("Menu/Admin");
                if (admin != null) {
                    try {
                    } catch (IOException ex) {
        } else {


The Authentication switch:

public class Authentication {

    static boolean isAuthenticated;

    public static boolean isIsAuthenticated() {
        return isAuthenticated;

    public static void setIsAuthenticated(boolean isAuthenticated) {
        Authentication.isAuthenticated = isAuthenticated;

The layer.xml:

<folder name="Actions">
    <folder name="Windows">
        <file name="org-demo-OpenSecurityAction.instance">
            <attr name="displayName" stringvalue="not used"/>
            <attr name="instanceCreate" newvalue=""/>
<folder name="Menu">
    <folder name="Admin">
        <attr name="position" intvalue="1000"/>
        <file name="org-demo-OpenSecurityAction.shadow">
            <attr name="originalFile" stringvalue="Actions/Windows/org-demo-OpenSecurityAction.instance"/>
            <attr intvalue="0" name="position"/>

The secret Admin Action:

public final class SecretAdminAction extends AbstractAction implements Presenter.Menu {

    public void actionPerformed(ActionEvent e) {
        //not used, set actions on menu items instead

    public JMenuItem getMenuPresenter() {
        JMenu menu = new JMenu("User Administration");
        if (!Authentication.isIsAuthenticated()) {
        } else {
            menu.add(new JMenuItem("Show Users"));
            menu.add(new JMenuItem("Change Users"));
        return menu;


Thursday Jan 16, 2014

Integrated AngularJS Development

What do we mean by "Integrated AngularJS Development"? Integrated AngularJS Development means having all the tools that you need at your fingertips in a single environment.

And that's what NetBeans IDE 8 gives you (even more than NetBeans IDE 7.4 and previous releases did).

  • Need to do some AngularJS coding? OK, we'll fire up an HTML editor. And a JavaScript editor. And a CSS editor. No, let's not do that. Just start up the super light and shiny new NetBeans IDE 8 for HTML5 and PHP development and you'll have all three editors available in one single development environment.

    Click here to get there fast.

    And here's the result, i.e., a super slimmed down NetBeans IDE with only frontend tools. And a heap of samples!

  • Need the AngularJS Seed template? I guess we'll go to the AngularJS Git repo and then... No, let's not do that. Stop doing that forever. It's not needed because right here in NetBeans IDE is the AngularJS Seed template.

  • Need to add some other JavaScript libraries? Hmmm... we'll need to go to Google and search for those libraries. Then find the relevant repo. Then make sure to get the latest version of the library. Then download it. Then add it to my project. Nope. No need for all that boring and error prone grunt work. Just select the JavaScript libraries you need, during creation of the project, and add more afterwards, via dialogs that link off to And you can update the list anytime, which will pull in the latest versions of the JavaScript libraries.


  • Need to reference your files in your HTML files? OK, so now we have our JavaScript libraries, our CSS files, our image files... Hmmm... now the boring work begins of typing all the references to those files inside my HTML file. Wrong! Just drag and drop the files into the HTML file and magically all those references will be created for you.

  • Need to figure out where the views are for the controllers? We need to look for a "Search" feature and then type in the name of... No! No need for that either. Hold down the Ctrl key and then move your mouse over the reference to the HTML file or to a controller, in the "app.js" file. Then the reference becomes a hyperlink which you can click to jump to the referenced view or controller.

  • Need to figure out what those AngularJS directives mean? Look, sooner or later one needs to do some research. So, let's go to the AngularJS site and look for the directives there and then... Forget about it! The AngularJS documentation is built right into the editor, you'll see it during code completion.

  • Need to figure out the properties you defined in the controller? Yes, you're in the view, happily coding away and need to refer to the controller properties in your ng-repeat definition or somewhere else in your HTML. So, let's look for that controller file... hmmm... where is it. No! No need for that either. Call up code completion and it will suggest to you the properties applicable to the current context in the view.

    Above, also notice that "beer" is underlined in grey, telling me that I have not yet used that variable. The code completion below is especially sweet, since it doesn't only give you access to the controller, but to the JSON that you defined within the methods within the controller:

    angular.module('myApp.controllers', []).
      controller('MyCtrl1', function($scope) {
          $scope.allbeers = [{name:'heineken'},{name:'grolsch'}];

    So the "name" that you see in the code completion below comes from the "name" in the function above, in the relevant scope.

  • Need to deploy the app during development? Sigh. Now I need to deploy the app and then kind of figure out where those images and other resources that I see in the browser are defined back in the development environment. Oh well. Bit of a pain, really. Not really, not at all! There's a plugin for the Chrome browser that enables NetBeans IDE and the Chrome browser to interact with each other. Clicking in the browser shows you where rendered resources are defined back in the IDE! And vice versa!

  • Need to deploy to a browser on a mobile device? Yeh, this part is not much fun. Figure out command line calls to iOS and Android... then deploy them there, and the Android emulators are kind of slow, and it's all a bit of a hassle. Maybe skip trying out the app on all mobile devices, just too much work, let's focus on only the most popular ones. No need! Simple tools in the IDE let you deploy directly to your browser, whether on the desktop or on the mobile device, including iOS, if you're on Mac OSX, of course.

  • Need to work in Chrome Developer Tools and keep changes synchronized with files in NetBeans IDE? Yeah, that's, like, totally impossible. Wrong!

  • Need to debug and style on the mobile device? Yeah, well, forget about it. That's just not possible. Wrong again:

  • Need to deploy natively to mobile devices? Wow. Need to learn ObjectiveC. That's got to suck. And maybe having a native app on Android isn't so important either. Let's just convince our users that the browser on the mobile device is just as cool as native apps. Nope! No need to be a spin doctor anymore. Just use Cordova (a.k.a. PhoneGap), accessible and configurable from NetBeans IDE. Via one or two clicks, Cordova will create a native app for you for either iOS or Android and you can even deploy your Cordova generated app straight to the mobile device from NetBeans IDE.

  • Need to set up Karma? Oh, yes, Karma would be great as a test runner. Lots of buzz around Karma. Need to go on-line and figure out how to set up Karma. Probably quite a bit of work involved in that, so let's put that on the backburner for later. In the meantime, I'll just do without testing, will do that later when I have Karma set up. No need for this approach, either. As soon as you've created your AngularJS Seed template, you also have Karma support in NetBeans IDE, since the IDE figured out from the AngularJS Seed template that Karma support needs to be set up for you.

  • Need to set up Grunt? SASS? LESS? Oh, yes, there's these other cool technologies to include, somehow. Hmmm. Probably hard work. Let's also not do that immediately. Wrong again! Here it is, you can select them from the New File dialog and incorporate them immediately.

    And here's SASS, the movie:

  • Need to use Emmet and CoffeeScript? Well, that's all nice but I need Emmet and CoffeeScript. Not seeing those in the New File dialog, so I guess I'll... Wait! Just go to the Plugin Portal and you'll find what you're looking for.

  • Need to check the sources into Git? Doing well now, time for a break, let's check everything into Git. OK, let's call up the command line and... Wait! No need for the command line, NetBeans IDE has great Git support built into it.

Wow, so... wait... all I need is NetBeans IDE..? Well, if you say so!

Wednesday Jan 15, 2014

YouTube: Streams, Lambdas, and Method References in Java 8

In this brief and silent YouTube clip, we end with this method, which uses a method reference in a stream:

public synchronized int getNumberOfItems() {

Another way we express the same method is as follows, which uses a lambda in a stream:

public synchronized int getNumberOfItems() {
    return -> x.getQuantity).sum();

And we start with this one:

public synchronized int getNumberOfItems() {

    numberOfItems = 0;

    for (ShoppingCartItem scItem : items) {

        numberOfItems += scItem.getQuantity();


    return numberOfItems;


How to get from the above to the compacter JDK 8 equivalents, via various alternatives, watch the silent movie below.

You'll notice that I keep moving with my mouse into the left sidebar. I do this to show what I'm doing because if I had pressed Alt-Enter each time, to popup the hint suggestions, you wouldn't have seen what I'm doing. In real life, you would press Alt-Enter each time you see the mouse move into the left sidebar above.

And, by the way, what you also see above is that refactoring works across lambdas, streams, method references, and the traditional Java code.

More on lambdas:

More on streams:

More on method references:

Thanks to Ralph Ruijs from the NetBeans Java Editor team for providing this entire sequence, plus a few others, today. A full step by step YouTube movie, with audio explanations of all the code, will follow soon.

Tuesday Jan 14, 2014

Three Tips for Moving from Eclipse to NetBeans IDE

Today was Martijn 'Wicket' Dashorst's impressive first day with NetBeans IDE 8 (a development build, by the way, which makes it even more impressive). In his article, describing a typically complex enterprise project, he writes:

"An IDE I have never worked with for more than a couple of hours beat an IDE I have lived in 10 hours a day, 5 days a week for the past 10 years with setting up this beast of a project."

So, here are three tips for Martijn (to the extent that he's not aware of these) and everyone else following Martijn's path.

  1. Use Maven. Migrating from one IDE to another goes most smoothly if you use Maven since all IDEs understand Maven in one way or another. In the case of NetBeans IDE, you'll not get IDE-specific proprietary files thrown into your source structure because NetBeans IDE treats the POM as your project file. The other awesome thing about Maven in NetBeans IDE is that it simply works out of the box and that every release of NetBeans IDE comes out with new enhancements and performance improvements for Maven.

  2. Keyboard Shortcuts. No need to learn new keyboard shortcuts. Go to Tools | Options and then use the Keymap tab to switch to the Eclipse profile. (IntelliJ IDEA profile and Emacs profile are there too.) If anything is missing in the Eclipse profile, let us know, we'd love to support Eclipse refugees even better than we already do.

  3. Formatting. Eclipse has heaps of formatting rules, which you can continue using in NetBeans IDE. Export your Eclipse formatting file and then import it into NetBeans IDE, via the Eclipse Formatter plugin in Tools | Plugins, as well as here in the Plugin Portal

Are there other Eclipse refugees out there who have other tips to share for making your new home in NetBeans IDE? Leave comments here or blog about them yourself!

Monday Jan 13, 2014

Phaser and NetBeans IDE (Part 3)

In part 1 and part 2 I introduced Phaser a bit. Let's now set up our project so that Phaser objects such as "Sprite" can be seen in code completion, as shown below:

What you need to do is clone the Phaser sources into your project's "www/js/libs" folder. Then wait a bit for background scanning to complete, which is when the parsing is set up.

And then you can use code completion, as shown in the screenshot above (click to enlarge it). Another approach is to create a symlink to your project from the cloned Phaser sources. Yet another approach is to use a PHP project, instead of an HTML5 project, since the PHP project has an include path setting in the Project Properties dialog, where external sources can be included for editor purposes, where the "phaser/src" folder can be registered. 

The approach of using the Phaser sources actually conforms to the standard way of developing applications with Phaser, as stated here: "You should include phaser.min.js in your html when you deploy the final, finished version of your game. Until that point you should use phaser.js (the non-minified version) as you'll get accurate debugging / line numbers from it should something die internally." (See here.)


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.


« April 2014