Monday Apr 13, 2015

Free: Inject Extra Power into the Browser!

Are you getting everything you can out of your browser? Sure, the browser can do so much more with new and richer content than a few years ago. However, did you know you can connect it to your development environment?

Install the free NetBeans Connector plugin into the Chrome browser and you're good to go:

Once you've installed the above, what can you do with it?

Quite a lot! Here are some small examples:

So, go here, and inject new power into the browser, for free, today!

Friday Apr 10, 2015

NetBeans Platform Certified Training at Fontys University of Applied Sciences

Yet another NetBeans Platform Certified Training was held recently. At Fontys University of Applied Sciences in Venlo, a group of students is working on a logistics simulation software called LIMO, which stands for "Logistics Impact Model":

The purpose of the project, created together with and for TNO, is to graphically visualize logistics chains, simulate costs, and generate advice on how to reduce or eliminate expenses.

The source code is on GitHub:

Here's the group:

In two days, all the major NetBeans Platform topics were covered, many hands-on workshops were done, and by the end, after a lot of interaction and discussion, the group was able to plan several new features for the project. For example, a NetBeans-based Project System will be added and undo/redo functionality will be integrated into the Visual Library Scene. A prototype of the new features, as well as the existing Scene with its simulation capabilities is shown below: 

Are you also creating client-side applications and would you like to be able to immediately focus on the domain/business logic, rather than all the infrastructure and plumbing that desktop applications require? For domain-driven desktop programming, the NetBeans Platform is a perfect solution. Either get the awesome book "NetBeans Platform for Beginners" or the equally awesome JavaFX-oriented book "JavaFX Rich Client Programming on the NetBeans Platform". Or get both. And take a NetBeans Platform Certified Training, to quickly put all the pieces together, 100% free if you're a group of developers at an educational institution.

Thursday Apr 09, 2015

Sample REST Application

For some time in NetBeans IDE, there's been this example available in the New Project dialog:

The template above creates a new NetBeans Platform application that consumes services from the "Message Board" application that is available in the "Web Services" category in the New Project dialog.

I looked at the code of the "Sample REST Application" and, since it had been written some years ago, a lot of XML files are included, instead of annotations on TopComponents. And there are other problems in the example, too. Rather than updating it within the NetBeans sources, I think it's better to have the code available separately, so it can be worked on and extended further by anyone out there. So, here it is:

Here's the structure of the sample REST application, together with the Java EE application that provides the services:

Notice that the NetBeans Platform application uses Maven as its build system.

When both applications are deployed, you see the following, click to enlarge the image:

Related issue:

Wednesday Apr 08, 2015

22 June, 2015: NetBeans Day Brazil

In February, we had NetBeans Day Netherlands, while March was NetBeans Day Germany. In April, i.e., next week, it's NetBeans Day Greece, while NetBeans Day UK is in May. And, guess what, you can now also sign up for... NetBeans Day Brazil, to be held in June, the day before JavaOne Brazil:

Go here to sign up for this free event:

Tuesday Apr 07, 2015

New Book on JavaFX

Diese Buch bietet Ihnen einen schnellen Einstieg und umfassenden Überblick über die gesamte JavaFX-API. Schritt für Schritt zeigt es, wie Sie eine erste Anwendung bauen, wie Sie das eigene Datenmodell in der Oberfläche darstellen und editierbar machen und wie Sie die Anwendung mit JavaFX-Features anreichern, um ein modernes und ansprechendes User Interface zu erhalten.

Dabei lernen Sie u.a., folgende Möglichkeiten von JavaFX einzusetzen:

• Controls nutzen und anpassen
• Formulare layouten und eigene Layouts erstellen
• Charts/Diagramme erzeugen
• Animationen erstellen
• Audio und Video einbinden
• Anwendungen mit CSS stylen
• Nebenläufigkeit nutzen

Anhand eines durchgängigen Beispiels können Sie die besprochenen Inhalte praktisch nachvollziehen und vertiefen. Darüber hinaus können Sie das Buch bei der späteren Projektarbeit zum Nachschlagen einsetzen.

Das Buch richtet sich gleichermaßen an Einsteiger und Umsteiger in JavaFX.

The book is by NetBeans Dream Team member Toni Epple, and is available in German right now, as you can see above, from here:

Monday Apr 06, 2015

Mocha and Chai and NetBeans -- Unit Testing for JavaScript

Mocha and Chai work great with the unit testing support that is a standard part of NetBeans IDE for JavaScript files, as Adam Bien shows below:

Adam's blog on this is here:

Friday Apr 03, 2015

How My Life Would Have Been So Much Better If We Had Used the NetBeans Platform

Came across this today from some years ago. If I may say so myself, about something created and delivered by me myself, I'd say this is still really excellent content and should help anyone getting started creating their applications on the NetBeans Platform:

Once you've watched the above, do yourself a favor and get this book:

Thursday Apr 02, 2015

Updated NetBeans Twitter Page

Are you following NetBeans on Twitter? Do so, lots of info is spread in that way. Today the NetBeans Twitter page was updated and refreshed.

Click above or go here to get to the NetBeans Twitter page:

Wednesday Apr 01, 2015

Using Bower Package Manager

New support for the Bower package manager, a popular technology for JavaScript/HTML5 application development, is being worked on. Here's something to get you started, showing Bower's key features in NetBeans:

Also see this issue, which describes improvements made after the above was made, i.e., automatically the .bowerrc file is now created:

Tuesday Mar 31, 2015

YouTube: Debugger for JDK8’s Nashorn JavaScript in NetBeans IDE

Since the release of JDK 8 and NetBeans IDE 8, NetBeans has provided a built-in debugger for JDK8's Nashorn, the new lightweight high-performance JavaScript runtime built on top of the JVM.

With NetBeans IDE, you can add breakpoints to your Nashorn scripts and go through them when debugging your Java application. When you're debugging, you can step where no developer has stepped before: from your Java code into your JavaScript code.

To see this in action, watch this quick 5 minute screencast. Together with seeing Java and Nashorn being debugged together seamlessly, you'll see that Nashorn can also be integrated into a NetBeans module, i.e., you're able to extend NetBeans IDE via JavaScript!

Monday Mar 30, 2015

Extending NetBeans with Nashorn

Let's take our JavaScript/JavaFX code (for running Yeoman and displaying results in JavaFX) and integrate it into a NetBeans module. At the end of this blog entry you'll have a NetBeans module that looks as follows:

The 'yeoman.js' file is similar to the one blogged about here. Slightly tweaked, it's at the end of this blog entry.

It's registered in the layer file above like this:

<folder name="nashorn">
    <file name="yeoman" url="nbres:/org/netbeans/modules/yeoman/yeoman.js"/>

And here's the code in an Action (e.g., invoked from a menu item) that finds the JavaScript file and evaluates it via Nashorn:

Import statements:

import javafx.application.Platform;
import javafx.embed.swing.JFXPanel;
import javax.script.ScriptEngine;
import javax.script.ScriptException;
import jdk.nashorn.api.scripting.NashornScriptEngineFactory;

Here's the JavaScript, i.e., runs Yeoman and displays results in JavaFX:

/* global $OUT, generator, FXCollections, javafx, $STAGE */
var WebView = javafx.scene.web.WebView;
var StackPane = javafx.scene.layout.StackPane;
var Scene = javafx.scene.Scene;
var FXCollections = javafx.collections.FXCollections;
var Label = javafx.scene.control.Label;
var ComboBox = javafx.scene.control.ComboBox;
var VBox = javafx.scene.layout.VBox;
var HBox = javafx.scene.layout.HBox;
var stage = javafx.stage.Stage;
var output = $OUT;
var cleanedOutput = [];
output = output.substring(81, output.length - 553).split("\n");
for each(generator in output) {
    if (generator.length > 0) {
options = FXCollections.observableArrayList(cleanedOutput);
selectedGenerator = new Label();
comboBox = new ComboBox(options);
comboBox.valueProperty().addListener(new javafx.beans.value.ChangeListener({
    changed: function (observableValue, oldSelection, newSelection) {
var root = new VBox(10);
var box1 = new HBox(10);
var box2 = new HBox(10);
box1.children.addAll(new Label("Choose a generator: "), comboBox);
root.children.addAll(box1, box2);
var stage = new javafx.stage.Stage();
stage.scene = new Scene(root, 400, 300);
stage.title = "Yeoman Generator";; 

Further reading:

Saturday Mar 28, 2015

Combining Nashorn Scripting with JavaFX

Following from yesterday's blog entry, the question I had was: "Can I use -scripting and -fx at the same time?"

The answer is yes:

 /* global $OUT, generator, FXCollections, javafx, $STAGE */
var output = $OUT;
var cleanedOutput = [];
output = output.substring(81, output.length - 553).split("\n");
for each(generator in output){
    if (generator.length>0){
options = FXCollections.observableArrayList(cleanedOutput);
selectedGenerator = new Label();
comboBox = new ComboBox(options);
comboBox.valueProperty().addListener(new javafx.beans.value.ChangeListener({
    changed: function (observableValue, oldSelection, newSelection) {
var root = new VBox(10);
var box1 = new HBox(10);
var box2 = new HBox(10);
box1.children.addAll(new Label("Choose a generator: "), comboBox);
root.children.addAll(box1, box2);
$STAGE.title = "Yeoman Generator";
$STAGE.scene = new Scene(root, 280, 100);

The above runs Yeoman on the command line via JavaScript, thanks to Nashorn, and displays the result in JavaFX:

And this is how the code above looks in NetBeans:

Indeed, this would appear to be the start of a shell script enabling Yeoman to be used from JavaFX.

By the way, to do the above, and to use the info in Adam's recent screencast and in my blog entry from yesterday, you need a NetBeans development build and then use the Nashorn tab that has been introduced there, i.e., this is not in NetBeans IDE 8.0.2 but in a development build for the next release:

Friday Mar 27, 2015

JavaFX in JavaScript

Did you know you can code JavaFX in JavaScript? See here, click to enlarge it:

Even simpler than the above, it can also be expressed in JavaScript like this:

For some context, see Adam Bien's latest YouTube clip:

Tip: When using JavaFX with Nashorn, set the '-fx' flag in the place where Adam uses '-scripting' above.

As Adam shows, you can debug Nashorn:

Finally, the code snippets in the screenshots above come from this repository by Bruno Borges, which I learned about from him in an excellent session by Bruno about Nashorn at JavaLand this week:

Thursday Mar 26, 2015

Mobile Boilerplate and NetBeans IDE

It turns out NetBeans IDE has even more powerful tools than you thought...

Wednesday Mar 25, 2015

NetBeans Day Brazil: Monday, June 22, 2015!

During JavaLand, Vinicius and Yara and I decided... that the day before JavaOne Brazil (23 to 25 June in Sao Paolo) will be... NetBeans Day Brazil!

Here's a pic I took of them today at JavaLand: 

Watch this space for news and announcements about NetBeans Day Brazil! 

Tuesday Mar 24, 2015

A Simple Starter Project With Grunt

In your package.json file:

    "name": "simple-app",
    "private": true,
    "version": "0.0.0",
    "description": "A Simple Starter Project With Grunt",
    "repository": "",
    "devDependencies": {
        "grunt-contrib-copy": "0.4.x",
        "grunt-contrib-clean": "0.4.x"

In your Grunt file:
/* global module */
module.exports = function (grunt) {
        pkg: grunt.file.readJSON('package.json'),
        'Compiles all the assets and copies the files to the build directory.',
       [ 'clean', 'copy' ]

Monday Mar 23, 2015

29th May: (Free) NetBeans Day UK!

As announced at NetBeans Day during JavaOne 2014, we're holding multiple NetBeans Days throughout the world, in part to celebrate the 20th year of Java's existence.

In December, we had NetBeans Day Germany, in February NetBeans Day Netherlands, in March NetBeans Day Germany again, in April NetBeans Day Greece is coming up, and May... is NetBeans Day UK:

Sign up and join in:

And what will happen in June? Where in the world will NetBeans Day be held in June, July, etc? That's up to you! Propose a place where it should be held and the NetBeans community will work with you to set it up. 

Saturday Mar 21, 2015

Asset Management on NetBeans

I recently visited an asset management firm in the Netherlands, where various internal applications are created by the internal IT department. Here's their main application, used for asset management, i.e., stock trading and similar activities:

The above is yet another NetBeans Platform application. Especially the Window System, i.e., the docking framework, of the NetBeans Platform is considered to be very useful by the developers.

In the above application, data is pulled in from various web services, and managed in the application, which is basically a container for data. In fact, you could look at it as a highly customized browser. Had the application been a web app in FireFox, or some other existing browser, there wouldn't have been enough control over its functionality. Therefore, the developers created their own browser, to have maximum control over every aspect of the application. That's all that such desktop applications are and it explains the continuing need for desktop applications.

Here you see the application in action by one of its users, i.e., if you're managing assets, you typically have multiple monitors, showing multiple different applications. One of these, you can see on the far right, is the application shown above.

Other applications are being created on the NetBeans Platform by the same organization. For example, here you see an internal document management system, for printing, and similar activities. What's interesting is the lower part of the screenshot below, which is a JavaFX WebView component, containing a JQuery form in the bottom right. That means that a NetBeans Platform application can even integrate with JQuery; that's pretty cool, I think.

I always find it really interesting to come across applications such as the above two. They have in common that they're in the back office of an organization, that you're never going to read about them on the organization's website. In fact, I've been asked not to mention the name of the organization nor where it is.

In short, let's not base our understanding of the popularity of a technology on the analysis of GitHub or on seeing what people are using at conferences or using Google trends or things like that. Instead, if we want to know what's actually being used and done in the software domain, we need to really become anthropologists and go out into the field and meet people at the organizations where they work and see what they're actually doing. From the lowlevel subjective view, something higher level objective can maybe be extrapolated, and not the other way round. Indeed, that's a lot of work and much more difficult than running some scripts to analyze GitHub. But any other approach simply neglects the scenarios I've been describing in this blog over the past 10 years, where few of the applications I've encountered are on GitHub, even fewer are described on the company website, and almost none of the developers go to conferences, so all of these use cases fall under the radar.

Friday Mar 20, 2015

Human Rights, Amnesty International, and NetBeans IDE

At the headquarters of Amnesty International  in the Netherlands, quite a lot of interesting work is being done with NetBeans IDE. In this blog post, I'd like to briefly share the basic details of one of these projects.

With the Urgent Action App, created by Amnesty in Amsterdam, currently only available in Dutch though that will change, you're able to very quickly become engaged in human rights campaigns by efficiently signing petitions and sending e-mails to protest human rights abuses.

The app can be installed onto either Android or iPhone.

The technology stack for the backend of the Urgent Action App includes Java, Java EE, GlassFish, and NetBeans IDE. RESTful web service calls from the frontend, created in AppMachine ( are integrated into a Java EE backend that does the following:

  • collects registration data from users of the app who join the action network by filling in their details
  • stores data when  users sign forms in support of an action around human rights abuses
  • periodically creates a petition list from the support forms and presents them to applicable organizations and representatives
  • helps to show the level of support for a particular action and ensures that a petition can't be signed more than once

Below, you see a photo of Amnesty International software developers, from left to right, Bert Menting and Ed van Velzen, with NetBeans IDE 8.0.2 on their laptop, in the Amsterdam HQ office of Amnesty International in the Netherlands. 

Among many other features that they like in NetBeans IDE are the smooth integration of NetBeans IDE with GlassFish, the ease with which RESTful web services can be developed via helpful templates in NetBeans IDE, together with advanced Java coding features, such as "Find Usages" and the built-in free Java Profiler. They also appreciate the fact that NetBeans IDE is free and open source software. 

Great to see human rights work being enabled and empowered through tools and technologies that include Java, Java EE, GlassFish, and NetBeans IDE!

Thursday Mar 19, 2015

NetBeans at JavaLand

Next week I'll be at JavaLand. Looks like most of the "thought leaders" in the whole Java world will be there, when you look at the program:

A session I'm doing is on Tuesday, 24 March, from 12:00 to 12:45. Looking forward to it!

I interviewed Markus Eisele from the JavaLand organization when it was launched, last year:


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.


« June 2015