Saturday Sep 12, 2015

"NetBeans IDE for Beginners" Exists!

You know you want it. Get it here:

Friday Sep 11, 2015

YouTube: Debugging Multiple Languages Simultaneously in NetBeans IDE 8.1

Truffle debugging support is demonstrated here in NetBeans IDE 8.1 by Jaroslav Tulach from Oracle Labs:

Monday Sep 07, 2015

New! The Power of MindMaps in NetBeans IDE

It is very important to keep the distance between a project and its knowledge as short as possible and the ideal variant is to keep that knowledge just within the project, as a document set. Learn how to do that with Igor Maznitsa's handy MindMap plugin for NetBeans IDE.


Sunday Sep 06, 2015

YouTube: Gradle in NetBeans IDE

Julien Ponge already mentioned it recently on Twitter:

And it's trueAttila Kelemen has done an awesome job in creating this plugin, as this quick movie proves:

Saturday Sep 05, 2015

@codapps_io in Amsterdam with Codename One and NetBeans

All the way from Lyon, in a bus tour that passed through cities like Milan, Munich, and Prague, the Codapps bus tour arrived in Amsterdam yesterday. In a room volunteered by codecentric, which had moved into it about half a week ago so everything was still very sparse and fresh, the next part of the Codename One tutorial sessions began, with NetBeans as the development environment.

Led by Clement Levallois, an enthusiastic assistant professor from Emylon Business School in Lyon, France, the group had arrived from Berlin shortly before starting the session in Amsterdam. Read all about their tour here, as well as here on Facebook. And there's a great blog about the whole trip, blogged live, here!

I had never myself used Codename One before, and I came an hour late (because of rain, a flat tire, and a long trip from Venlo) but I caught up very quickly. In about 10 minutes I had created my app:

...using NetBeans IDE to do so:

Then we were shown how to send the app to Codename One, where we were able to pick up our APK file, or another file depending on the format we had chosen, and install it on our phones!

Afterwards, there was beer and conversation with developers I'd never met before. What an amazing way to promote Java technologies. Hope the Codapps team does this again sometime! Read all about their adventure here.

Friday Sep 04, 2015

Architecture & Solutions for Sustainable Java Applications (Part 2)

Today, in part 2 of the modular architecture course at Fontys University of Applied Sciences in Venlo, the Netherlands, we focused on components for data display in the NetBeans Platform, together with the related techniques for modularity and loose coupling.

The chosen domain was network satellite management. We ended up with a GUI editor for modifying data managed in a tree and in a table. Each Satellite, named "Awesome" and "Amazing" below, has one or more Antennas, e.g., "Main" and "Secondary", consisting of Parts, e.g., "Big" and "Small".

In the middle, you see "hello venlo", which is the start of a Visual Library scene, i.e., the label that you see can be moved around, etc, and ultimately can be extended to create a graph-like visualization of underlying data.

The most interesting and unique part of the architecture of the above application is that the tree and the table (actually, a treetable, thanks to the OutlineView component from the NetBeans Platform) are in different modules. What they share is an ExplorerManager, which we refactored into a separate module, together with the node hierarchy and related factories:

The "SatellitData Controler" that you see above returns an ExplorerManager, which is shared between the two TopComponents that you see highlighted above. In both TopComponents, an explorer view looks up the component hierarchy, finds the shared ExplorerManager, and renders its data.

Altogether, with all its clever techniques and strategies, the NetBeans Platform enables component-based development with shared and decoupled data managers. 

Thursday Sep 03, 2015

Architecture & Solutions for Sustainable Java Applications (Part 1)

As reported on NetBeans Facebook, another training course kicked off today at Fontys University of Applied Sciences in Venlo, the Netherlands, focusing on using the NetBeans infrastructure as the basis of sustainable Java applications:

Two applications were developed during the first day of the course. After lunch, time was spent on the application below, a word processing application that makes use of modularity and loose coupling solutions that are part of the NetBeans Platform:

In the above, the window on the right does not know about the window on the left and its drop-down list contains processors that it doesn't know anything about either! Yet they are there and yet communication happens between the windows...

The modular structure of the above is as follows, i.e., the windows are in separate modules, just like the services, which are loaded into the GUI in a loosely coupled manner:

Earlier in the day, the class created a game platform, shown below, consisting of the games found here in the NetBeans Plugin Portal:

The structure of the application above is modular, i.e., each of the items below are modules contributed to the game platform:

Do you want to learn about sustainable architectures for Java desktop applications too? The course is described here, is free for JUGs and educational institutions and has been taught all over the world for many years, at organizations focused on aerospace, oil flow analysis, and many other typical Java uses cases, as can be seen on the NetBeans Platform Showcase.

Tuesday Sep 01, 2015

"Hack" Font in NetBeans IDE is Great!

A flurry of Tweets a day or so ago re Hack and NetBeans IDE:

John Sirach, from the PiDome project (which won a Duke's Choice Award last year), who started the flurry above and has now introduced the Hack font to the NetBeans community (thanks for that John!), likes this font because it makes code look good even when the font size is small. Here's a screenshot he sent me, with the font size set to 10px:

Here's how it looks for me, I'm using it fulltime now, with font size 18px (nice for teaching and so on), and "Dark Metal" from the "Dark Look and Feel Themes" plugin:

The above is a screenshot that is included in The Complete Guide to Tuning the Appearance of NetBeans.

Get the "Hack" font here:

Monday Aug 31, 2015

Available: Official PDF of "Beginning NetBeans IDE for Java Developers"

Today I went to the Apress site for the new NetBeans book "Beginning NetBeans IDE for Java Developers". I used PayPal to pay for the PDF, since the hardcopy isn't available yet. I'm really looking forward to holding the hardcopy in my hands, the PDF is definitely secondary to me, though having it available is nice too! When I ordered it today, I assumed that I'd get sent some old version of the PDF of the book, together with the message: "Soon you will receive the final PDF of the book, for the moment here's a recent draft."

However, that was not the case at all! The final PDF of the book is available, right now. That's really great. Features that the final PDF of the book has, which early drafts did not have, and which the hardcopy book obviously will not have, either:

  • Bookmarks, as shown in the screenshot below.
  • Hyperlinks in the table of contents to the referenced pages.
  • Internal links, e.g., when the text says "as shown in Figure 3-2", there's a link on "3-2", which can be clicked, and then you're jumped to the related image.
  • Color in the screenshots, i.e., unlike the hardcopy book, the screenshots are not black/white, except for the awesome portraits of famous NetBeans users by Martien Bos

Here's an image of the book, showing Adam Bien's preface, as well as the bookmarks along the left side of the PDF reader:

And here's the start of the chapter on testing and code coverage, notice the hyperlinks mentioned above.

Get the book here:

Sunday Aug 30, 2015

NetBeans in Cancer Research in Pakistan

My background is not in IT, but in law—I grew up in South Africa and did my law degree there, focusing on subjects such as international law, labor law, and human rights law. I would certainly have become one of those typical human rights lawyers who inspired me to do a law degree in the first place—one of those lawyers from 90% of court room drama movies—pleading the innocence of an unjustly accused innocentshaking a self righteous finger at the heavens against the injustice of it allor standing on the ramparts of some eventually to be vindicated—after many years of hardship and struggle"lost cause".

It is with that kind of background that I am always so very pleased when the aspects of NetBeans that have always appealed to me most—free, open source, solid, stable, simple to get started, helpful community—are combined with the kind of vertical segment of software development that is closest to the kinds of concerns I had before being sidetracked into software—in this case, the software being developed at Shaukat Khanum Memorial Cancer Hospital in Pakistan:

The above is a laboratory automation integration solution being created at the aforementioned hospital in Pakistan on top of the NetBeans Platform and with NetBeans IDE. It integrates 63 pathology lab machines and analyzers into one coherent application, supporting a range of protocols. The system bi-directionally communicates with true random access analyzers, such as General Chemistry (e.g., Hitachi P-800, COBAS 6000) and Special Chemistry (e.g., Advia, Immulute), where analyzers read the tube barcodes and inquire the system for the test orders and receives them, analyzes samples, and reports back the results to the system. Other features include user/roles/rights management, integrated simulation for quick testing and debugging, and an easily accessible user interface for maintaining the analyzers and other machines, together with their support documents and manuals.

Many—even most—of my software colleagues will look at the above screenshot and say: "Oh my god! Why is that not a web app!" or "Wow—that needs to be converted to JavaFX, doesn't it?" And those software colleagues would be completely missing the point. Not going to explain this in detail again, have done that so many times already, but the web is simply not applicable to all imaginable business scenarios, while Java Swing is certainly a lot more stable with a lot more experienced developers available than JavaFX, and the usefulness that JavaFX would add to this particular application is so small that the significant investment that would be required would not be worth it.

When I read about the above software and write e-mails with the related software developers working in that hospital, to advise them on solutions they're working on for their software, yes, at that moment there's a very small and humble part of me that resonates with an earlier part of me, a younger part, sitting in a law lecture or, even, quite recently, listening to former head of the South African Constitutional Court, Albie Sachs, talk about his background and the motivations for the ways in which he has spent his life.

Friday Aug 28, 2015

YouTube: Overview of Newly Designed NetBeans Profiler

The redesign of the NetBeans Profiler is one of the big enhancements of the NetBeans IDE 8.1. In the release notes, you'll see a whole section dedicated to this:
  • Redesigned user interface
  • New features:
    • Live forward and reverse call trees in CPU results
    • Live allocation trees in Memory results
    • Monitoring CPU utilization
    • Thread dumps from profiled application
  • Engine improvements:
    • Faster connection to profiled application
    • Limited outgoing calls from profiled methods
    • Memory profiling for selected classes
  • Simplified profiler setup
  • Improved integration into the IDE

And, great newstoday, Josh Juneau, a NetBeans Dream Team member, has made available an excellent screencast on YouTube showing how friendly and usable the newly designed NetBeans Profiler is:

Thanks, Josh!

Thursday Aug 27, 2015

New: Complete Guide to Tuning the Appearance of NetBeans

The full article is here and will be added to and updated over time and should be considered the most complete and authoritative document on the topic of tuning the appearance of NetBeans:

Wednesday Aug 26, 2015

New from Apress: "Beginning NetBeans IDE for Java Developers"

Well, yesterday I heard the good news—the new Apress book "Beginning NetBeans IDE for Java Developers" has gone to the printer! This ends a cycle that started some months ago, with many in the NetBeans community being involved. Several people from the NetBeans Dream Team, as well as teachers using NetBeans around the world, and some of the subscribers on the NetBeans mailing list.

Here's where the book can be purchased:

Some sneak previews are in order! Here's what the cover looks like:

Here's the more readable version of the small squiggly text you see on the back of the book above:

Of course, the book is focused on NetBeans IDE 8.1, e.g., the newly designed NetBeans Profiler is used in the chapter on Profiling. What does the table of contents look like? Here it is:

It's a reasonably thorough introduction to NetBeans IDE, though there's certainly room for another book on NetBeans IDE to be entitled "The Definitive Guide to NetBeans IDE", as well as another book in the "Beginning" series, e.g., "Beginning NetBeans IDE for JavaScript Developers".

The foreword is by Jaroslav Tulach and the preface is by Adam Bien. Each chapter begins with a relevant quote from a famous NetBeans user, and a portrait of that user by the brilliant professional illustrator Martien Bos, e.g., the chapter on Profiling begins with a portrait of Kirk Pepperdine, with a quote from Kirk about how awesome the NetBeans Profiler is. Similarly, Arun Gupta is featured in the chapter where you develop a Java EE application, while others included include James Gosling, Toni Epple, Zoran Sevarac, Sean Phillips, Sven Reimers, and Ken Fogel.

The book is aimed at students at universities and technical colleges, etc, (in fact, it would be great if it would become something of a standard text at educational institutions) as well as developers in the enterprise. In the book, Maven and, to some extent as well, Java EE, are a bit dominant, though if you're using something different, you'll gain a lot from the book too. Initially an Ant-based "Hello World" application is created, later a more complex Java EE application with Maven, though each chapter stands on its own. By the end, you have a basic overview of the key features of NetBeans IDE.

More info about this book will be revealed over the coming weeks/months, including interviews with some of the many people involved in the book, and, of course, it will play a big role in a variety of activities around NetBeans as soon as it is released!

Tuesday Aug 25, 2015

Kendo UI Core in NetBeans IDE 8.1

Good news for users of Kendo UI Core, everywhere. Problems in the initial release of the Kendo UI Core plugin have been fixed and, if you're using NetBeans IDE 8.1 Beta (or later), you'll have code completion for Kendo UI Core components, together with documentation, once the plugin is installed:

But... there's more! In code completion, in the place where you'd expect it, you also get code completion for the attributes of the currently used Kendo UI Core component, together with related documentation:

When you're using Visual Studio, you'll miss the above feature, i.e., context-sensitive code completion of attributes of Kendo UI Core components, since it's simply not supported fully or completely or correctly there:

Go here to get the plugin:

Many thanks to a variety of people involved in working on and supporting the Kendo UI Core Editor plugin for NetBeans IDE. In the first place, Johan Borchers for suggesting this feature for NetBeans IDE and also for trying it out multiple times, until we fixed the issues we initially had and now it works for him too in NetBeans IDE 8.1. Giorgio Del Cielo, thanks to you too, for trying out the plugin and reporting that it now works for you. Also, very many thanks to the Brazil team who worked on the documentation parsing of the Kendo UI Core Editor plugin during JavaOne Latin America, consisting of Mauricio Leal, Leonardo Zanivan, and All Pereira.

Many thanks to everyone. And there's still quite some work to be done, especially in the performance and caching of parsing results, i.e., these aspects are not optimal yet. Anyone wanting to get involved, there's a GitHub repo that contains all the code:

Anyone using the plugin, please help by providing any kind of feedback, either here or on the plugin's page in the Plugin Portal.

Monday Aug 24, 2015

YouTube: Chrome Connector Plugin in NetBeans IDE 8.1

One of the best features for JavaScript development in NetBeans IDE is the Chrome Connector plugin, which connects the browser to NetBeans IDE and enables the Chrome browser—whether on the desktop or on a mobile deviceto integrate fully into the development cycle.

NetBeans IDE 8.1, which is currently in Beta, has some awesome enhancements for working with the Chrome browser via the Chrome Connector plugin. In particular, Polymer is supported for the first time via live Shadow DOM visualization and Knockout.js is even further integrated into the development cycle via a new window that shows live Knockout bindings of the currently selected item in the Chrome browser.

Find out all about the new features, plus a few additional handy tips and tricks, in a brand new YouTube screencast, here:

Watch more NetBeans videos here:

Friday Aug 21, 2015

Hello Perforce in NetBeans IDE

Figured out how to add the Perforce item below:

How to do it:

Below is the starting point, in the layer.xml, included in the Git repo above:

<folder name="VersioningOptionsDialog">
    <file name="Perforce.instance">
        <attr name="instanceClass" stringvalue="org.netbeans.perforce.PerforceAdvancedOption"/>

The rest follows from there, see the Git repo above that contains the entry point for configuring Perforce in NetBeans IDE.

Related info:

Thursday Aug 20, 2015

Overriding Default Context-Sensitive Action Enablement

By default, when you create an Action that is context sensitive, via the New Action wizard, the NetBeans Platform looks out for the types that are of interest to you and, when they're in the Lookup, enables your Action. In the case below, when multiple Parts are in the Lookup, i.e., typically, multiple PartNodes are selected and their underlying Part objects are published, the Action will automatically be enabled:

        category = "Parts",
        id = ""
        displayName = "#CTL_PartComparatorAction"
        path = "Menu/File", 
        position = 1200)
@Messages("CTL_PartComparatorAction=Compare Parts")
public final class PartComparatorAction implements ActionListener {
    private final List<Part> context;
    public PartComparatorAction(List<Part> context) {
        this.context = context;
    public void actionPerformed(ActionEvent ev) {
        StringBuilder sb = new StringBuilder();
        for (Part part : context) {
            sb.append(part.getName()).append(" ");

However, the default behavior is such that even when only one Part object is exposed to the Lookup, the Action is enabled, as shown below:

The above doesn't really make sense because you need more than one of something to make it worthwhile to compare. To override this default behavior, you can abandon the default underlying class and implement your own enablement strategy.

Begin by including "lazy = false", shown in bold below, which will generate layer.xml entries that, instead of delegating to the internal NetBeans Platform code for handling enablement, lets you provide that enablement yourself, as shown here:

        category = "Parts",
        id = ""
        lazy = false,
        displayName = "NOTUSED"
        path = "Menu/File",
        position = 1200)
@Messages("CTL_PartComparatorAction=Compare Parts")
public final class PartComparatorAction extends AbstractAction {
    Lookup context;
    public PartComparatorAction() {
        context = Utilities.actionsGlobalContext();
        putValue(NAME, Bundle.CTL_PartComparatorAction());
    public boolean isEnabled() {
        return context.lookupAll(Part.class).size() > 1;
    public void actionPerformed(ActionEvent ev) {
        StringBuilder sb = new StringBuilder();
        for (Part part : context.lookupAll(Part.class)) {
            sb.append(part.getName()).append(" ");

Now, as is implied by the isEnabled method above, only when more than one object of interest is in the Lookup, will the Action be enabled. Below you can see that, in contrast to the earlier screenshot, the Action is disabled here because of the code above, which overrides the default behavior:

Note that in the second code scenario, you get hold of the Lookup yourself, you check whether the correct objects are available in the Lookup and then enable/disable as appropriate, and you also iterate through the objects in the Lookup to process them when the Action is invoked. In the default scenario, all this is done for you automatically, with the downside that even when only one object is available the Action will be enabled.

Also see:

Tuesday Aug 18, 2015

Complex Properties Windows on the NetBeans Platform (Part 2)

In part 1, you ended up removing the UI components from the custom Properties window whenever the Lookup changes. That's kind of messy and here's an alternative approach, where you repopulate the custom Properties window instead of recreating its UI components.

public class PlanetPropertiesTopComponent extends TopComponent
        implements LookupListener {

    private Lookup.Result<PlanetNode> planetNodeResult;
    private final JPanel mainPanel;
    private boolean isInitialized = false;

    public PlanetPropertiesTopComponent() {
        setLayout(new BorderLayout());
        mainPanel = new JPanel(new MigLayout());
        JLabel title = new JLabel();
        add(title, BorderLayout.NORTH);
        add(mainPanel, BorderLayout.CENTER);

    public void resultChanged(LookupEvent le) {
        if (!planetNodeResult.allInstances().isEmpty()) {
            PlanetNode planetNode
                    = planetNodeResult.allInstances().iterator().next();
            if (!isInitialized) {
            } else {

    private void initializeContent(PlanetNode planetNode) {
        List<Property> booleanProperties = new ArrayList<Property>();
        PropertySet ps = planetNode.getPropertySets()[0];
        Property<?>[] props = ps.getProperties();
        for (Node.Property property : props) {
            SinglePropertyJPanel ppJPanel
                    = new SinglePropertyJPanel(property);
            if (property.getValueType().equals(boolean.class)) {
            } else {
                        "dock north, wrap, growx, pushx");
                new MultiPropertyJPanel(booleanProperties),
                "wrap, growx, pushx");
        isInitialized = true;

    private void repopulateContent(PlanetNode planetNode) {
        PropertySet ps = planetNode.getPropertySets()[0];
        Property<?>[] props = ps.getProperties();
        for (Node.Property property : props) {
            Component[] components = mainPanel.getComponents();
            for (Component component : components) {
                if (component instanceof SinglePropertyJPanel) {
                    SinglePropertyJPanel spjp = (SinglePropertyJPanel) component;
                    PropertyPanel pp = spjp.getPropertyPanel().get(0);
                    String ppDisplayName = pp.getProperty().getDisplayName();
                    if (ppDisplayName.equals(property.getDisplayName())) {
                } else
                if (component instanceof MultiPropertyJPanel) {
                    MultiPropertyJPanel mpjp = (MultiPropertyJPanel) component;
                    List<PropertyPanel> ppList = mpjp.getPropertyPanel();
                    for (PropertyPanel pp : ppList) {
                        String ppDisplayName = pp.getProperty().getDisplayName();
                        if (ppDisplayName.equals(property.getDisplayName())) {

    private void writeTabDisplayName(PlanetNode planetNode) {
        String displayName = planetNode.getDisplayName();
        setDisplayName(displayName + " - Properties");

    public void componentOpened() {
                = Utilities.actionsGlobalContext().lookupResult(PlanetNode.class);

    public void componentClosed() {


Monday Aug 17, 2015

Java Everywhere: Write Once Run Anywhere with DukeScript

For quite some time already, Java has been failing on its “write once, run anywhere” promise. DukeScript ( would like to change that by enabling a clean separation of view and logic in cross-platform applications. In this article, a simple scenario is used to introduce the basics of DukeScript.

For many years, Java Swing enabled developers to write applications that could run on any operating system. That all came to an end with the arrival of smart phones, tablets, and embedded computers. In the enterprise, the desktop dominated for many years. In the meantime, however, every IT project includes plans for a future where the application will need to be ported to mobile platforms. Building native applications for all platforms requires special skills and is expensive in terms of both maintenance and development. What is to be done?

DukeScript gives you a Java-based solution again that enables cross-platform applications to be developed. DukeScript provides a clean separation of view and logic enabling UI designers to focus on UI design and coders to focus on writing well-tested application code. 

Read all about it here, which is where the paragraphs above come from: and learn how to create a cross-platform To Do List application:

Sunday Aug 16, 2015

Simplified Reflection for AbstractNode

When using BeanNode, you don't need to create a PropertySheet because the NetBeans Platform uses reflection to build that for you. However, when using AbstractNode, you don't have that built-in reflection support. Instead, you need to override createSheet() in your AbsrtractNode and then, in the simplest cases, you can populate your PropertySheet by creating Properties that extend PropertySupport.Reflection.

I've come up with a simplified way of doing that:

protected Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set basicSet = Sheet.createPropertiesSet();
    Planet planet = getLookup().lookup(Planet.class);
    try {
        basicSet.put(new PropSupport.StringProp(planet, "name", "Name"));
        basicSet.put(new PropSupport.IntegerProp(planet, "size", "Size"));
        basicSet.put(new PropSupport.ColorProp(planet, "color", "Color"));
        basicSet.put(new PropSupport.BooleanProp(planet, "hasWater", "Has Water"));
        basicSet.put(new PropSupport.BooleanProp(planet, "hasLife", "Has Life"));
        basicSet.put(new PropSupport.PlanetTypeProp(planet, "type", "Type"));
    } catch (NoSuchMethodException ex) {
    return sheet;

And here's PropSupport, i.e., my own class, essentially an API, that hides the below via the method calls above:

public class PropSupport {

    public static class StringProp 
        extends PropertySupport.Reflection<String> {
        public StringProp(
                Planet bean, 
                String propName, 
                String displayName) throws NoSuchMethodException {
            super(bean, String.class, propName);
    public static class ColorProp 
        extends PropertySupport.Reflection<Color> {
        public ColorProp(
                Planet bean, 
                String propName, 
                String displayName) throws NoSuchMethodException {
            super(bean, Color.class, propName);
    public static class IntegerProp 
        extends PropertySupport.Reflection<Integer> {
        public IntegerProp(
                Planet bean, 
                String propName, 
                String displayName) throws NoSuchMethodException {
            super(bean, int.class, propName);
    public static class BooleanProp 
        extends PropertySupport.Reflection<Boolean> {
        public BooleanProp(
                Planet bean, 
                String propName, 
                String displayName) throws NoSuchMethodException {
            super(bean, boolean.class, propName);
    public static class PlanetTypeProp 
        extends PropertySupport.Reflection<PlanetType> {
        public PlanetTypeProp(
                Planet bean, 
                String propName, 
                String displayName) throws NoSuchMethodException {
            super(bean, PlanetType.class, propName);


Now I can pass in a few arguments and get back via reflection my underlying properties very easily.


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.


« December 2015