Implementing Auto Updates for a Netbeans Platform Maven Application Using Github Pages
Tuesday July 17 2018

Being able to update an application when a new version is released is something of critical importance for desktop applications. Otherwise, the process of updating the application is extremely tedious since you have to download more installers all the time.

Luckily, Netbeans Platform comes with integrated support for enabling your custom applications to be able to be updated when a new version is released.

In this post I will go over how to implement this on a Maven based Netbeans Platform application.

How Netbeans Update Center Works

The Update Center is how we can achieve this functionality. The way it works is that you publish your module's NBM files to a web server, along with a XML catalog file that contains information about the modules such as latest release timestamp, latest version, etc.

When you configure an update center in your application, you will configure this web server's URL so that the update center client knows where to poll and where to download the new module files to install.


BytesIO File Uploads to Django Using Requests
Tuesday June 26 2018

It's very easy to post file data to Django using requests:

import requests, files={'cover': open('imgpath.jpg', 'rb')})

However I was having a hard time getting that to work using BytesIO. The reason I wanted to use BytesIO was because I was reading the file binary data located in S3, from AWS Lambda. I didn't want to write the file to disk first and then do something like the code shown above.

Here's how to achieve that:


Using Listeners in Custom Netbeans Platform Wizards
Tuesday May 22 2018

This tutorial explains how you can add validation to your custom wizards in the Netbeans Platform. This works by setting a boolean variable to false and then throwing a WizardValidationException which will show an error message in the wizard, disabling the ability to click the Next or Finish buttons.

The problem with this is that after the above happens, there is no way to enable these buttons again. And the way to achieve this is not covered in that tutorial.

Therefore, in this blog post I will explain just how to do that.


Netbeans Platform Node Icon Badges
Thursday May 03 2018

The Netbeans IDE has some very cool way of letting users know when a certain file contains errors. For example, if you are editing a Java file and the file contains syntax errors, Netbeans will change the file icons with a new icon indicating errors:

Netbeans Error Icons

You can see that the error icons propagate all the way up to the top-most parent, the project itself.

Netbeans Platform Icon Badges

As a user of the Netbeans IDE and before even knowing what the Netbeans Platform was, I always assumed that the normal state of the icon and the error state of the icon were two completely different icons handled by Netbeans. A few days ago I learned that this is not the case.

Netbeans uses the concept of icon badges to display these kind of error icons. Icon badges are basically multiple images merged together at runtime into a single Image object.

In this article I want to quickly go over how you can apply this concept in your Netbeans Platform application when using the Nodes API.


Creating Toolbars for MultiView Elements in Netbeans Platform
Monday April 23 2018

On a previous post I talked about creating a new file type that Netbeans Platform can recognize and display the file's data in different ways by creating different visual editors that implement the MultiViewElement interface.

However, that tutorial did not cover how to add a custom toolbar to each multi view. Like the one Netbeans already provides when editing source code:

Netbeans MultiView Toolbar

This is a very handy toolbar that can be used to add buttons that perform different kinds of actions with the current active file.

A Deeper Look Into the MultiViewElement Object

If you recall from the previous post, a JPanel that implements MultiViewElement was created after finishing the wizard. This MultiViewElement object has some very important characteristics that are key to this tutorial: