Friday Jan 10, 2014

Free Graphs to Manage Maven Complexities

Let's admit it, Maven can be a total nightmare. 

The only real way to get a thorough understanding of what's really going on in that Kafkaesque POM file is to draw a picture. Better still, a dependency graph. And NetBeans IDE has done that for you for sometime already, though an excellent enhancement in the upcoming NetBeans IDE 8.0 release is that you can change the layout of the graph. See below, just right-click the graph and then choose a different layout:

Notice also that you can "Export As Image" (and then send to your manager to prove how complex your work really is). And below you see the hierarchical layout, vertical layout, and horizontal layout: 

Don't you feel calmer and more organized (and smarter), just by LOOKING at the graphs above..? 

However, the point isn't only to INTERPRET the world in various ways, but to CHANGE it. Easily done, just right-click one of those blocks and you can choose to exclude it: 

Doing the above doesn't just change the PICTURE, i.e., doesn't simply make it easier to understand what you're SEEING, but it actually CHANGES the POM, as you can see in the History tab below, which is of course also awesome to have integrated right inside your POM file, with the possibility of reverting local changes: 

And then I didn't even mention the Effective POM tab, which has been there for a while, but is awesome too.

Finally, the plugin you need to install to get the above functionality is... nothing! Because the above, as with all Maven features in NetBeans IDE, is simply built into the IDE and is available the second you've started it up. 

NetBeans IDE manages the complexity that Maven inherently brings with it. And all for free. And out of the box.

Thursday Jan 09, 2014

WildFly Simply Works in NetBeans IDE 8.0

Get a daily development build of NetBeans IDE 8.0 and then go to Tools | Plugins to install the WildFly plugin, created by some of our friends at Red Hat.

Here's the location of the daily development build: 

Then you can deploy apps to WildFly from NetBeans IDE and see the deployed artifacts in the Servers node: 

Emmanuel Hugonnet, who's driving this effort inside Red Hat, reports that the WildFly plugin is currently almost as complete as the NetBeans support for GlassFish. Some work remains to be done on data sources, but in general the plugin is in good shape.

Wednesday Jan 08, 2014

Interview with Authors of "NetBeans Platform for Beginners" (Part 1)

On Leanpub, a new book entitled "NetBeans Platform for Beginners" is being written by Jason Wexbridge and Walter Nyland. (There's also a new NetBeans Platform book to be released soon on Amazon, by Paul and Gail Anderson, click here for details.)

I've known about the Anderson book for a while, but not about the one by Walter and Jason. So I sent them some questions! Here are their responses.

Hi Jason and Walter. Firstly, I must admit that your names are pretty unfamiliar. What's your involvement with and connection to the NetBeans Platform?

Jason: Hi Geertjan and, yes, you're not going to find our names anywhere. We're part of the "lurking community" of the NetBeans Platform mailing lists. And we thought it was time to contribute back.

Walter: Right. The NetBeans Platform is an awesome framework, though the books on it are outdated and the information around it very scattered through the web universe.

So, you decided it was time to put a new book together. What's your experience with the NetBeans Platform?

Walter: We've worked in various industries where the NetBeans Platform is used, primarily on underwater control systems, as well as military-related software. The NetBeans Platform is quite well known in those worlds.

But everyone is creating mobile apps nowadays and web applications, right?

Jason: Wrong. That's all hype. In the real world, when you need a secure system that is reliable and can handle truly heavy amounts of data, while being performant, the desktop is your friend.

Walter: Exactly right. Mobile devices are handy for games and maybe sales-type activities, but if you're doing anything even remotely meaningful in the scientific world, or in geospatial analysis, or analysis of any kind, really, you need the desktop with all its increasing processing capabilities.

Let's now talk about the book. What's unique about it?

Walter: Some of the existing books aren't as clear as they could be.

Jason: And all of them are outdated in one way or another.

Walter: Also, some focus on one example throughout the book, which can be painful if you want to learn one particular thing. Others are purely reference material, without any content of immediate practical value.

Jason: We've tried to combine these approaches into something that is hopefully better. Each chapter begins with a thorough theoretical basis. That's the first part of each chapter, almost like a referential underpinning for the second part, which is almost tutorial-style in putting real code on the screen.

Which topics do you cover?

Jason: That's also unique about this book, in that our scope is very narrow. We only want to cover the key features of the NetBeans Platform, e.g., module system, window system, action system, lookup. Those kinds of topics. Each chapter is dedicated to one of these core NetBeans Platform themes.

Is the book really for beginners only?

Walter: It's definitely a complete starters pack for beginners. However, anyone is likely to gain from it, at whatever level of NetBeans Platform development you're at. Several topics are discussed that you won't find anywhere else.

Jason: By the end of the book, anyone with a solid Java background will really be able to build meaningful applications on the NetBeans Platform. Code samples throughout the book solve many typical problems and questions NetBeans Platform developers have. It's really focused on being something like a "Bible" to the NetBeans Platform.

What do you consider to be the NetBeans Platform's key strengths?

Walter: Definitely three things. Firstly, modularity, enabling good code organization and pluggability. Secondly, the file system, which provides the spine of any NetBeans Platform application. Thirdly, the Lookup, which provides loosely coupled communication on every level of NetBeans Platform applications.

Jason: I'd agree with that. All the rest of the NetBeans Platform is based on those three pillars.

Sounds like you've got a really thorough understanding of the NetBeans Platform! What are the release plans of the book?

Jason: Certainly by the end of this month, i.e., by the end of January 2014. After that, we're going to focus on books that didn't fit within the scope of this one, e.g., a book on Maven and the NetBeans Platform, a book on creating source editors, i.e., creating an IDE on top of NetBeans IDE for a domain-specific language, and a book on NetBeans IDE itself, which we consider to be the best IDE out there.

Wow, wonderful. Anything else you'd like to share?

Walter: Yes. Everyone, please go to the book's site, read the sample PDF that is already out there, and let us know how much you'd like to pay for the completed book. That information is really important, we're trying to figure out how much to charge for the book, also considering that we're making a big investment in terms of our time and energy, plus we're looking at writing more NetBeans-oriented books, as you can see above, so we're trying to get a better idea of our market!

Many thanks, Jason and Walter! And, NetBeans Platform developers out there, please support this great effort by going to the site above and reading the PDF, leaving comments for Jason and Walter, and by telling them how much you'd pay for the completed book.

Tuesday Jan 07, 2014

"Defect Driven Design" -- Kirk Pepperdine killed some of my awesome screencasts recently. I've been moving them to YouTube. The awesomest of my awesome screencasts is without any doubt the announcement of "Defect Driven Design", in a crowded and trendy Stockholm bar, all the way back in 2010, with Kirk Pepperdine:

Monday Jan 06, 2014

Central Bank Collaborative Modelling on the NetBeans Platform

jcMod, which stands for Java clustered modelling, is a collaborative modelling platform developed in South Africa. It integrates the many modelling tasks found at a typical inflation targeting central bank in a controlled, multi-user environment and offers advanced functionality for data capture, modelling, simulating and reporting. It also maintains a repository of all past data, models and reports for future reference.

The application is fairly advanced but also highly customized to the needs of a central bank, especially if that bank is an inflation targeting central bank. It can also be used at any econometric modelling institution. The problem is that a typical modelling institution will have to use multiple applications in order to be able to construct the diverse suite of models required today. This leads to huge integration issues. The application offers a lot of integrated modelling, data and report writing functionality and thus allows for easy collaboration.

jcMod supports a large number of models, such as exponential smoothing, OLS, NLS, ARIMA, ARCH, GARCH, VAR, SVAR and VECM models. jcMod can simulate and optimise multivariate models, Kalman filters and DSGE models and can sample, using Gibbs or MCMC sampling, parameters from these models. Its modular nature means jcMod can easily be extended to support more models, with neural networks planned for the nearby future for example.

jcMod's reports are used by both the modelling team and the monetary policy committee (MPC) and its report editor, apart from normal editing, also allows for the layout of equations and advanced plotting of data, such as histograms and fan charts. Reports and images can be exported in bitmapped or vector (EMF and EPS) formats.

jcMod makes heavy use of Java and NetBeans Platform 7.4 but takes care not to introduce any other external dependencies and jcMod clients can run on any recent JVM.

More screenshots:

Sunday Jan 05, 2014

Phaser and NetBeans IDE (Part 2)

More fun with Phaser.

And here's the code:

var game = new Phaser.Game(800, 270, Phaser.AUTO, '', {preload: preload, create: create, update: update});
function preload() {
    game.load.image('sky', 'assets/sky.png');
    game.load.spritesheet('cat', 'assets/runningcat.png', 512, 256, 8);
function create() {
    game.add.sprite(0, 0, 'sky');
    player = game.add.sprite(40, 0, 'cat');
    cursors = game.input.keyboard.createCursorKeys();
    player.animations.add('walk');'walk', 5, true);
function update() {
    if (cursors.right.isDown) {'run', 70, false);
    else  {'walk', 5, true);

Two (silent) YouTube movies with NetBeans and Phaser:

Saturday Jan 04, 2014

Phaser and NetBeans IDE (Part 1)

I had fun learning Phaser today, a fast, free, and fun open source game framework for making desktop and mobile browser HTML5 games.

A great tutorial:

The result in NetBeans IDE:

Friday Jan 03, 2014

Leiningen, Clojure, and NetBeans IDE

Leiningen is Clojure's build tool, here in action in NetBeans IDE 7.4:

Above you can see how "lein run", "lein clean", "lein jar", "lein uberjar", and "lein help" are supported, while here is "lein new app":

An especially cool little feature is that you can hold down the Ctrl key and then mouse over a method, then a hyperlink appears, which can be clicked to invoke the "lein run -m" command on the method:


Some problems with lexer, once those are fixed, will make the plugin available in the NetBeans Plugin Portal.

Thursday Jan 02, 2014

Google Translate in NetBeans IDE 7.4

Google Translate API is a paid service from the Google Cloud. Once you've set up your API key and billing information, you can use it in NetBeans IDE, too, of course.

Notice the from/to toolbar, where I've selected English/German: 

Then, above I right-click over a selection and choose "Translate", which I get back in German: 

The code is more or less the same as it was in my 2007 article on this topic:

However, in the meantime there's a REST API that can be used instead. I'm not using the REST API, still the same code as the above, though slightly changed because of changes in the Google Translate API:

public void actionPerformed(ActionEvent ev) {
    Language from = TranslatorPanel.from();
    Language to =;
    try {
        JTextComponent comp = EditorRegistry.lastFocusedComponent();
        String toChange = comp.getSelectedText();
        String text = TranslateV2.DEFAULT.execute(toChange, from, to);
    } catch (java.lang.NullPointerException ex1) {
    } catch (GoogleAPIException ex) {

All the source code of the above is here:

Wednesday Jan 01, 2014

Scala in NetBeans IDE 7.4

Caoyuan Deng, the author of the Scala plugin, starts the year off well with the announcement that the Scala plugin for NetBeans IDE 7.4 is available:

New features:

  1. Format code using Scalariform;
  2. Run/Debug sbt project/file. (For debug, you need to attach debugger by yourself [Debug -> Attach Debugger] after invoke 'Debug' action)
  3. Sbt 0.13.1
  4. nbsbt-1.1.0 has been published to
  5. Implicit call is now highlighted with italic fonts.

Fixed features:

  1. Various fixes for code completion;
  2. Multiple opened Sbt/Scala consoles now work properly;
  3. Better Jump/Open to declaration position of source file.

Here's what you see after installing the plugin (i.e., unzip the ZIP file, go to Tools | Plugins, use the Downloaded tab to install the NBM files):


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.


« January 2014 »