Monday Dec 30, 2013

Java Database Programming Training Video

In this Java Database Programming training course, expert author Mike McMillan shows you the concepts and tools you will work with in order to successfully build functional database programs using Java.

You will start out by setting up a database using MySQL. You will learn how to create tables, insert and query data, and update and remove records. From there, Mike will show you how to use Java to connect to MySQL. This video tutorial will also teach you advanced database techniques, including installing, setting up, and creating tables in NetBeans IDE. You will learn how to create a Java/MySQL application and a NetBeans Platform application. Finally you will learn how to use the built-in Derby database in NetBeans IDE.

Sunday Dec 29, 2013

New Book: "NetBeans Platform for Beginners"

Not only Gail and Paul Anderson are working on a brand new book on the NetBeans Platform, "JavaFX Rich Client Programming on the NetBeans Platform", as reported yesterday, but so are Jason Wexbridge and Walter Nyland, see below:

Though the book isn't available yet, a sample PDF can already be downloaded, as you can see in the image above. Reading through the preface, it seems all core NetBeans Platform topics will be covered, e.g., System FileSystem, Lookup, Nodes, and TopComponents.

The authors would like to know, on the page above, how much you'd like to pay for the book! So, read the PDF, look at the writing style and content, and at the introduction and preface to see whether it will match your needs. Then let them know what you'd pay for it!

It will be good to have an updated book on all the core NetBeans Platform topics again.

Saturday Dec 28, 2013

New Book: "JavaFX Rich Client Programming on the NetBeans Platform"

Now built into Java and closely integrated with the NetBeans Platform, JavaFX 8 is today's state-of-the-art Java-based toolkit for creating advanced user interfaces, manipulating media, generating graphical effects and animations, and much more. This guide covers everything you need to know to create industrial-strength business applications with JavaFX 8 and NetBeans -- including how JavaFX impacts user experience design, graphical design, and development processes.

Focusing on JavaFX as the front end for tomorrow's most powerful rich client applications, this is the first book to cover the version of JavaFX 8 incorporated into the Java APIs with the official release of Java SE8, instead of obsolete preview versions.

Gail and Paul Andersen fully explain both JavaFX 8 and its relationships with the NetBeans Platform architecture, and systematically show Java developers how to use them effectively together. To support sophisticated real-world business development, they also thoroughly address JavaFX 8 interactions with backend databases, JavaEE, RESTful web services, and the Jersey client.

Release date is September 2014. More info here!

Friday Dec 27, 2013

YouTube: Make Your Clients Richer -- JavaFX and the NetBeans Platform

An excellent way to spend a couple of hours is watch Gail and Paul Anderson's JavaOne 2013 tutorial session (like, really, long, almost 3 hours) on JavaFX and the NetBeans Platform:

Thursday Dec 26, 2013

YouTube: Maltego Forensics Software and Nmap

Yet another great movie by the Maltego team on the latest features of their Java-based forensics software:

Wednesday Dec 25, 2013

Region-Specific CutAction

The CutAction, and other global Actions, can be shared between multiple TopComponents. Depending on what needs cutting, an Action together with the "cut-to-clipboard" key is added to the ActionMap of any TopComponent that needs to integrate with the CutAction.

But what about if you have different regions within a single TopComponent? Each region should have the CutAction delegate to a region-specific CutAction. Here's how to do that, with two simple JPanels representing two regions in the TopComponent:

public class DemoTopComponent extends TopComponent {

    private final ExplorerManager em = new ExplorerManager();
    private final JPanel subPanel1 = new SubPanel1();
    private final JPanel subPanel2 = new SubPanel2();
    private final ActionMap actionMap;

    public DemoTopComponent() {
        setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
        actionMap = getActionMap();
        associateLookup(ExplorerUtils.createLookup(em, actionMap));

    private class SubPanel1 extends JPanel {
        public SubPanel1() {
            setBorder(new TitledBorder(new LineBorder(Color.BLACK), "one"));
            addMouseListener(new MouseAdapter() {
                public void mouseEntered(MouseEvent e) {
                    setBorder(new TitledBorder(new LineBorder(Color.RED), "one"));
                    subPanel2.setBorder(new TitledBorder(new LineBorder(Color.BLACK), "two"));                   
                    actionMap.put("cut-to-clipboard", new AbstractAction() {
                        public void actionPerformed(ActionEvent ae) {
                            JOptionPane.showMessageDialog(null, "cut one");

    private class SubPanel2 extends JPanel {
        public SubPanel2() {
            setBorder(new TitledBorder(new LineBorder(Color.BLACK), "two"));
            addMouseListener(new MouseAdapter() {
                public void mouseEntered(MouseEvent e) {
                    setBorder(new TitledBorder(new LineBorder(Color.RED), "two"));
                    subPanel1.setBorder(new TitledBorder(new LineBorder(Color.BLACK), "one"));                   
                    actionMap.put("cut-to-clipboard", new AbstractAction() {
                        public void actionPerformed(ActionEvent ae) {
                            JOptionPane.showMessageDialog(null, "cut two");

    protected void componentDeactivated() {
        subPanel1.setBorder(new TitledBorder(new LineBorder(Color.BLACK), "one"));
        subPanel2.setBorder(new TitledBorder(new LineBorder(Color.BLACK), "two"));


Here you can see the result. In the image below, a panel is selected and the border is red, as defined above, and the CutAction is enabled, proven by the Cut button being enabled:

If the other panel were selected, the CutAction would also be enabled, but delegate to a different Action, as shown in the code above. If the Properties window or Output window were to be selected, there'd be no "cut-to-clipboard" key in the ActionMap of the TopComponent and hence the CutAction would not be enabled.

Tuesday Dec 24, 2013

Merry Christmas to the NetBeans Community!

Monday Dec 23, 2013

Busy Developer's Guide to Quickly Integrating HTML5 with Java EE 7

I did a talk at Devoxx 2013 on quickly integrating HTML5 with Java EE 7, using NetBeans IDE as the tool that provides all the integration features you need. Here you can get hold of the presentation, it lasts 1/2 hour and covers everything you need to know:

Saturday Dec 21, 2013

Python in NetBeans IDE 7.4

Let's set up NetBeans IDE 7.4 to use Python.

Go to Tools | Plugins and the Plugin Manager opens. In the Settings tab of the Plugin Manager, add a new update center with this URL:

Then go to the "Available Plugins" tab of the Plugin Manager and you'll find Python:

After installing the Python plugin, go to the New Project wizard and create your new Python project or import an existing Python project:

Then have fun with Python:

There's lots of features for Python, including debugging and code coverage.

If you don't expect it to be 100% perfect, you'll be 80% satisfied.

Friday Dec 20, 2013

StrikeIron RESTful Web Services Are Cool!

You have some kind of order entry form in your application where you enter customer details. Name, address, e-mail, etc. Wouldn't it be handy to know whether those details are valid? For example, the e-mail address you've been given could be wrong or the employee keying it in makes typos. Or the e-mail address was once right but has now been removed.

Enter StrikeIron! StrikeIron lets you instantly validate all customer contact information. Below you see a simple example. I have a text field where I entered my own e-mail address and via a StrikeIron service I get back a bunch of XML. The complete UI for this would show GUI components, probably checkboxes, with values filled in from the parsed XML, but for the moment I'm simply showing the XML payload in an editor pane:

In the context of NetBeans IDE, this doesn't make much sense since you're not going to be validating e-mail addresses while coding, most of the time. But imagine you have a business application on the NetBeans Platform, or a web application or any other business application on whatever framework, where customer details need to be entered. That's when the StrikeIron services become very interesting. 

How does it work? Well, aside from the StrikeIron SOAP services that are part of NetBeans IDE, and that have been there for several years already as this 2009 blog entry by StrikeIron CTO and co-founder Bob Brauer shows, there are also REST endpoints that you can use:

  • The VerifyEmail operation is called to perform email verification and hygiene on an email address. The URL for that operation with specific parameters is as follows:
    VerifyEmail.Option alSourceId=

    More details here (PDF)

  • The NorthAmericanAddressVerification operation is called to perform address verification on an address. The URL for that operation with specific parameters is as follows:
    NorthAmericanAddre ssVerificationService/NorthAmericanAddressVerification?
    LicenseInfo.Registered User.UserID=&
    NorthAmeric anAddressVerification.AddressLine1=&
    NorthAmericanAddressVerification. AddressLine2=&
    NorthAmericanAddressVerification.CityStateOrProvinceZIP OrPostalCode=&
    North AmericanAddressVerification.Firm=&
    NorthAmericanAddressVerification.Ur banization=&

    More details here (PDF)

There's other services too, such as an SMS service, which is pretty cool. 

Finally, how did I integrate the REST service into a NetBeans Platform TopComponent? Using HttpClient, exactly as I did recently with the TestFairy REST service, as documented here. I literally copied all the code from there and then just changed the URL and the variables.

Thursday Dec 19, 2013

YouTube: Automatically Undocked Windows on the NetBeans Platform

Another quick and soundless movie, around 7 minutes this time. Let's say you have a requirement in your NetBeans Platform application that all your windows should be undocked at startup of the application. How do you reconfigure the NetBeans Platform window system to support this? Rather than creating lots of configuration files manually and registering them manually in the layer.xml file, there's a much better and faster solution. But also less well known. Watch this screencast to find out!

The above is the answer to a question by Steve Montgomery from Austin, Texas. Are there other short things that you'd like to see, in relation to NetBeans IDE, on YouTube? Let me know! Your wish is, more or less, probably, without making any actual promises or commitments up front, my command!

Wednesday Dec 18, 2013

Maven Hierarchical View for NetBeans IDE 7.4

The Maven hierarchical view is now available for NetBeans IDE 7.4. Originally created for NetBeans IDE 7.2, thanks to a request from Kirk Pepperdine, as described here, you can now install it directly into NetBeans IDE 7.4:

The result:

The above is a screenshot of part of the sources (there are very many, didn't fit in the screenshot) of JAnnocessor, an "open-source framework for powerful, flexible, yet easy processing of annotated Java code".

Tuesday Dec 17, 2013

YouTube: Quick Turnaround for NetBeans Platform Developers

Another quick and soundless movie, this time 1 1/2 minutes! Run your NetBeans Platform application in Debug mode, make a code change, and then use "Apply Code Changes". That really speeds up development a lot.

Are there other short things that you'd like to see, in relation to NetBeans IDE, on YouTube? Let me know! Your wish is, more or less, probably, without making any actual promises or commitments up front, my command!

Monday Dec 16, 2013

YouTube: RESTful Web Service, Tomcat, and Maven

A small and soundless demo of 2 1/2 minutes that shows how to create a Maven application with a RESTful Web Service and deploy it to Tomcat.

Are there other short things that you'd like to see, in relation to NetBeans IDE, on YouTube? Let me know! Your wish is, more or less, probably, without making any actual promises or commitments up front, my command!

Sunday Dec 15, 2013

Quick Browser for NetBeans IDE 7.4

The Quick Browser I created sometime ago is now available for NetBeans IDE 7.4:

It's pretty handy, e.g., open NetBeans projects by clicking on them in the browser. Open individual files too:

Get it here:

More details on this are here:

Still same open issue as before, unresolved so far:

Friday Dec 13, 2013

Overheard at a Recent Conference...

Well, not so much "overheard", since I'm one of the two people in this conversation. (You can guess for yourself which one.) Let's imagine they're called "Fred" and "Joe". 

Joe: Well, it sure seems like all developers everywhere are creating nothing other than mobile apps these days.

Fred: How did you come to that conclusion?

Joe: Well, look around you at this conference. Everyone is constantly on their mobile phone, using the apps on their mobile phone, constantly, all the time, even while they're attending sessions at this conference, even while the speaker is talking. They're hardly even looking up at all anymore, they're typing away madly, twittering, or swiping, or whatever, all the time, on their mobile phone.

Fred: I see your point. But how many of those apps are backoffice banking applications for risk management analysis? How many of them are military applications for managing and predicting conflict outcomes? How many of them are air traffic control systems? How many analyze oil flows and reservoirs? And how many of the attendees at this conference are scientists doing protein analysis?

Joe: ...

Thursday Dec 12, 2013

NetBeans IDE Extension Workshop @ Fontys University of Applied Sciences (Part 2)

Another NetBeans IDE plugin development session was held at Fontys University of Applied Sciences in Venlo to continue learning about the topic of extending NetBeans IDE via creating new plugins. (Part 1 was described here.)

We had a fun time, with exercises in groups where Tetris, Pacman, and Breakout were ported to NetBeans IDE:

A future session could focus on how to remake these games in JavaFX. The code for the games we ported comes from here:

And here's where the three Java SE applications are found, i.e., install the plugin and you'll have the three applications with which the porting execise started:

Slightly dark picture of the group:

And the day ended with a quick overview of the basics of how to extend the NetBeans IDE Java Editor:

Wednesday Dec 11, 2013

Vert.x and NetBeans IDE

Getting set up with Vert.x in NetBeans IDE is a process of two steps:

Click Next, give it a name, click Finish, wait for half the internet to be downloaded, and here's your project:

Build the project, switch to the Files window, and notice that everything has been put in the right places:

Then use the "vertx run" command, as explained here and here.

Tuesday Dec 10, 2013

Watch JavaOne 2013 "Apples and Oranges -- Highlights of Eclipse, IntelliJ IDEA, and NetBeans"

Which IDE do you use for Java development? Eclipse? NetBeans? IntelliJ IDEA? Do you know what its most powerful features are?

Generally, developers stick to one IDE and configure it to match their daily programming needs. They don’t consider a different IDE, not really being aware of what they’re missing.

Because comparing apples with oranges doesn’t make sense, let’s instead look at what the key problems are that each IDE tries to solve. Is a hybrid development environment imaginable, where each IDE is available?

This JavaOne 2013 session, by Anton Arhipov, Max Andersen, and myself, doesn’t do a “shoot-out.” It shows you what makes each IDE unique, in turn, and what specific problems it tries to solve.

Monday Dec 09, 2013

KeyListeners and TopComponents

Just like JPanels, TopComponents are not focusable by default. They need to be explicitly defined as such, as shown below. Then key listening works, though remember that the TopComponent needs to be the currently active TopComponent, otherwise some other TopComponent will catch your key events.

public final class DemoTopComponent extends TopComponent {

    public DemoTopComponent() {
        addKeyListener(new MyKeyAdapter());

    private class MyKeyAdapter extends KeyAdapter {
        public void keyPressed(KeyEvent e) {
            int keycode = e.getKeyCode();
            switch (keycode) {
                case KeyEvent.VK_LEFT:
                    JOptionPane.showMessageDialog(null, "Left: " + e.getKeyCode());
                case KeyEvent.VK_RIGHT:
                    JOptionPane.showMessageDialog(null, "Right: " + e.getKeyCode());
                case KeyEvent.VK_DOWN:
                    JOptionPane.showMessageDialog(null, "Down: " + e.getKeyCode());
                case KeyEvent.VK_UP:
                    JOptionPane.showMessageDialog(null, "Up: " + e.getKeyCode());


Helpful reference which caused me to see the light:


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 2013 »