Sunday Dec 30, 2012

Code Completion for Lang Attribute in XHTML Files

Olivier Schmitt from the French Ministry of Agriculture published a brilliant article and sample code in his (French) blog recently:

The source code:

The result is code completion for the "lang" attribute in text/xhtml files: 

Source structure, take note of the CSV file, which is a cool way to get the code completion words:

I'm thinking of making the ultimate generic solution on top of Oliver's code: a new @CompletionRegistration annotation, that takes a MIME type, content (i.e., a list of completion words), and a condition (e.g., "lang" attribute). Then, at compile time, the layer entries are generated and mapped to Oliver's code. The @CompletionRegistration annotation would not be set on a class, but within the class, i.e., similar to how file templates can now be registered via @TemplateRegistration. In other words, nothing at all would need to be implemented or extended, no API, nothing at all; instead, you'd register some info via the annotation and then everything else would be generated for you and you could immediately begin using your newly mapped completion provider.

Friday Nov 30, 2012

Even More Steroids for JEditorPane

Got some help from Ralph today and now the JEditorPane is as I want it, e.g., code folds are now supported once you click in the JEditorPane, though there are still some side effects, since this is not how anyone anticipated NetBeans editor APIs being used. But, so far, the side effects (e.g., now the hyperlinks work, but they open a new JavaScript file when you click on one of them, instead of jumping within the JEditorPane itself) are not so terrible.

Error checking is also done now, which wasn't there before, i.e., red underlines and error annotations in the right margin. And maybe it's my imagination, but the editor feels a lot snappier, e.g., in code completion, than before.

I've checked in the changes, they're all in this file:

Saturday Oct 27, 2012

UNESCO, J-ISIS, and the JavaFX 2.2 WebView

J-ISIS, which is the newly developed Java version of the UNESCO generalized information storage and retrieval system for bibliographic information, continues to be under heavy development and code refactoring in its open source repository. Read more about J-ISIS and its NetBeans Platform basis here.

Soon a new version will be available for testing and it would be cool to see the application in action at that time. Currently, it looks as follows, though note that the menu bar is under development and many menus you see there will be replaced or removed soon:

About one aspect of the application, the browser, which you can see above, Jean-Claude Dauphin, its project lead, wrote me the following:

The DJ-Native Swing JWebBrowser has been a nice solution for getting a Java Web Browser for most popular platforms. But the Java integration has always produced from time to time some strange behavior (like losing the focus on the other components after clicking on the Browser window, overlapping of windows, etc.), most probably because of mixing heavyweight and lightweight components and also because of our incompetency in solving the issues.

Thus, recently we changed for the JavaFX 2.2 WebWiew. The integration with Java is fine and we have got rid of all the DJ-Native Swing problems. However, we have lost some features which were given for free with the native browsers such as downloading resources in different formats and opening them in the right application.

This is a pretty cool step forward, i.e., the JavaFX integration. It also confirms for me something I've heard other people saying too: the JavaFX WebView component is a perfect low threshold entry point for Swing developers feeling their way into the world of JavaFX.

Tuesday Oct 23, 2012

TopComponent, Node, Lookup, Palette, and Visual Library

Here's a small example that puts together several pieces in the context of a NetBeans Platform application, i.e., TopComponent, Node, Lookup, Palette, and Visual Library:

The result is a drag-and-drop user interface, i.e., drag items from the palette and drop them onto the window, that's all it does, nothing too fancy, just puts the basic NetBeans Platform pieces together in a pretty standard combination:

Monday Oct 22, 2012

NetBeans IDE 7.3 Keyboard Shortcuts

New keyboard shortcuts in NetBeans IDE 7.3:

  • Ctrl+Shift+D: Show clipboard history.

  • Alt+Shift+L: Copy file path.

  • CTRL+ALT+T: Reopen recently closed document.

  • Ctrl+Shift+S: Turn select mode on/off in embedded browser. 

Also note, Output window has configurable shortcuts now:

Source of the above info:

Monday Sep 03, 2012

Be There: Tinkerforge/NetBeans Platform Integration Course

Tinkerforge is an electronic construction kit. It exposes a number of API bindings, including, of course, Java. The nice thing also is that Tinkerforge products are open source, both on the hardware and software levels, so that you can take their bases as a starting point for your own modifications.

"The TinkerForge system is a set of pre-built electronics boards that are built in such a way that you can stack the boards (known as bricks), attach accessories (known as bricklets), and have your prototype and and running quickly. Unlike systems, such as the Arduino or Launchpad, the TinkerForge has to be attached to a computer and the computer does all of the work. With an easy set of application programming interfaces (APIs) available in C/C++, C#, Java, PHP, and Ruby, the system is easy to interface and program over USB in a snap." (from this useful article)

Henning Krüp, who has arranged several NetBeans Platform Certified Training Courses in the past, in the Nordhorn/Lingen area in Germany, had the inspired idea to focus the next course on integration with Tinkerforge. In other words, the whole course will be focused on creating a standalone Java desktop application that leverages the NetBeans Platform to interact with Tinkerforge!

Interested in joining the course or setting up something similar yourself? The course organized by Henning will be held from 19 to 21 September, as explained here, together with contact details.  If you'd like to organize a similar course at a location of your choosing, leave a comment at the end of this blog entry and we'll set something up together!

Thursday Jul 12, 2012

New Tutorial: Integrating JavaFX Charts into the NetBeans RCP (Part 1)

The "NetBeans Platform JavaFX Integration" tutorial provides step-by-step instructions for integrating JavaFX features into a NetBeans Platform application. Since the NetBeans Platform is typically used as a basis for corporate applications, the JavaFX chart components are ideal candidates for integration into NetBeans Platform applications. JavaFX, as a whole, is focused on bringing special effects to Java. In the context of charts, JavaFX provides a set of predefined charts, each of which can be animated, which is particularly useful to show changes in values presented in a chart.

The tutorial can be found here:

The end result:

Best of all, and you're unlikely to believe this until you try the tutorial: you're not going to need to code anything at all to get the above result. It's all simply a question of refactoring some of the JavaFX samples such that they run within NetBeans Platform window components. I.e., basically all you'll be doing is copying and pasting code from existing samples into windows, the code for which is generated from templates. A little bit of tweaking here and there, as you'll see in the tutorial, but about 98% of the code already exists and you just need to move it into the right places.

In the first part of the tutorial, you set up and run one of the standard JavaFX samples that comes with NetBeans IDE:

The above is a very nice sample, since it not only shows a JavaFX chart, but also a Swing JTable. The two are connected such that when a value changes in the table, the JavaFX chart changes and, importantly, is animated while it changes.

In the tutorial, you then create a new Java desktop application on the NetBeans Platform and move the code from the sample into a new window:

Next, you split the table from the JavaFX chart, i.e., in the screenshot below they're now in two separate windows, thus making the application more modular, since each window in this application is found within a separate module.

Finally, you're shown how to add additional JavaFX charts into the application and how to synchronize them so that all charts are animated simultaneously:

Naturally, the windows can be undocked and moved around (even outside the application frame, onto a different monitor, for example), since the NetBeans Platform has its own window system.

Quite a bit of additional content needs to be added to the tutorial. For example, the area chart in the tutorial isn't synchronized with the table and the other charts yet. Some explanatory text needs to be added to explain how the original sample works, i.e., what's in the table, what's in the chart, and how do they interact with each other. Also, the table needs to be fixed so that the header isn't excluded, as is currently the case. Another topic to be dealt with is how all this can be done in a Maven based NetBeans Platform application. And also the tutorial needs to be tried out on all operating systems, with any differences (e.g., on Mac) to be added into the tutorial. Finally, it needs to be explained how the same application can be distributed to different operating systems, i.e., how to handle native libraries for different operating systems. The tutorial itself is created on Windows and, at least initially, supports the Windows use case, though the long list of native libraries shouldn't be needed, just a subset of them, I just didn't know which ones were actually needed and included all of them.

Feedback welcome and it would be cool to hear from NetBeans Platform (and other Java desktop) developers everywhere about the cool things they're experimenting on in the context of JavaFX!

Friday Mar 09, 2012

NetBeans Plugin Development: Beginner's Guide

The book is by NetBeans Dream Team member Tushar Joshi. I am very much looking forward to it being published so I can get my hands on it!

Tuesday Mar 06, 2012

iX Magazine: "NetBeans 7.1: Alternative to Eclipse"

The latest, i.e., March 2012, edition of the German iX Magazine (the "magazine for professional information technology") landed on my doormat today.

Nice and shiny and glossy, at 170 pages, the general look and feel of this magazine reminds me of Dr Dobbs, covering the whole range of hot software development topics, from Cloud to Android, from Apache Solr to NoSQL.

From page 64 to 66, a review of NetBeans IDE 7.1 is published, by Michael Müller. The title is: "NetBeans 7.1: Alternative to Eclipse". To give a taste of the article, the intro text is as follows (translated from German by me, apologies for any inaccuracies in tone or content): "With the release of NetBeans 7.1, Oracle wants to compete with the established application development environment Eclipse. Via many new features, the IDE is thoroughly suited for professional use."

The review then continues with an examination of the new features in NetBeans IDE 7.1. A lot of attention is given to the beefed up refactoring support, under the subheading "Refactoring clearly enhanced", but pretty much everything that's cool, new, or enhanced in 7.1 is mentioned—JavaFX, GridBagLayout Designer, block selection, JPA, ICEFaces, RichFaces, CDI, Oracle Web Services Manager, web services, and more.

The review concludes with the following sentence: "The goal, namely an alternative to Eclipse, has been realized, and one notices Oracle's strong support within the product." 

Wednesday May 20, 2009

JavaSpektrum and NetBeans Articles

The latest JavaSpektrum, a German-language Java magazine, has some great articles relating to the products coming out of the NetBeans project:

NetBeans IDE:

-- NetBeans 6.X - die ultimative Java EE IDE?, by Adam Bien

NetBeans Platform:

-- Modulare Anwendung mit dem NetBeans-Lookup-Konzept, by Heiko Böck

-- NetBeans RCP - Das bessere Swing-Application-Framework? by Anton Epple

Toni also blogged about these articles, here. I wonder if these articles could be translated to English? All 3 of them should be made available to a wider audience and, after all, we have a tried and tested system of German-English translators, as testified by Sven Reimers, here.

So, what do you think, Adam, Heiko, and Toni? Maybe you could ask JavaSpektrum if we could translate the articles and then publish them somehow, maybe via or

Tuesday Aug 08, 2006

Upcoming German-language Javamagazin Features... NetBeans!

The title theme of the upcoming German-language Javamagazin is... NetBeans!

It will feature an interview with Jan Chalupa, the new NetBeans director, and Tim Boudreau, leading architect, theorist, evangelist, and presenter of the NetBeans Platform.

There will also be articles on the IDE itself, as well as on the NetBeans Platform. Plus... enterprise application development with NetBeans.

So if you're in Germany this Thursday, i.e., the 10th of August, note what the website says... "Ab 10. August 2006 am Kiosk!"

Better be quick, they're gonna sell like hot cakes!



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.


« February 2016