NetBeans 7.1 – JavaFX 2.0 support, refactoring enhancements and great Maven 3 integration
NetBeans 7.1 has just been released. It is interesting how NetBeans continues to evolve – after many doubts were raised with regard to its future after the Oracle-Sun acquisition. Oracle maintains two IDEs – each with its own objectives. JDeveloper to support Fusion Middleware development, NetBeans to propel the Java platform and its associates (Groovy/Grails, Scala) with even more focus on standards and open source. NetBeans also support PHP and C++ code development – though I have no personal experience worth mentioning in these areas.
NetBeans 7.1 is not a major overhaul – it is a continuation of the NetBeans IDE. However, it does add one major new area of functionality: JavaFX 2.0 support in addition to a number of valuable smaller enhancements. This article briefly touches upon a number of these enhancements – the one that most appealed to me. Download NetBeans 7.1 from http://netbeans.org/downloads/index.html.
An interesting webcast (10 minutes) about the 7.1 release can be found here: http://netbeans.org/kb/docs/ide/overview-screencast.html.
JavaFX 2.0 support
One of major evolutions on the Java platform is going on in the area of rich GUI development. JavaFX, first announced in 2007 (!) has taken some time to mature. After Oracle acquired Sun Microsystems, it made the fairly bold decision to discontinue FX Script, yet continue JavaFX in general. FX 2.0 has been positioned during JavaOne 2011 as the proposed successor AWT & Swing, to be complete integrated into the Java platform and made part of the JDK around or shortly after SE 8. The Summer of 2011 saw the preview release of FX 2.0, October the formal release as well as a preview for NetBeans 7.1 with FX support. Starting now, NetBeans 7.1 is done – with FX 2.0 support on board.
A new FX project is easily created in NetBeans – with all dependencies readily configured and an HelloWorld already implemented:
FX applications can be run from within NetBeans as Browser based HTML + Applet, standalone Java Application or through Web Start (JNPL).
Additionally, NetBeans has this nice ‘samples’ option that allows one to quickly get a project going with running sample code. Many FX samples are included, demonstrating best FX coding practices and many nice FX features.
For example the PuzzlePieces:
Closely associated with FX development are various debugging features, especially the Visual Debugger. When running an FX application in debug mode, the camera icon allows us to take a screen-capture.
Subsequently, we can inspect the code and structure of the FX scenegraph from that screen-capture.
The snapshot is clickable and when a certain area is clicked upon, the associated FX code can be navigated to:
That makes it really much easier to correct visual flaws and understand the flow through the FX components. Documentation on the Visual Debugger can be found at http://netbeans.org/kb/docs/java/debug-visual.html.
Java Coding and Refactoring
An area where NetBeans provides excellent support to developers obviously is Java programming. This 7.1 releases has some interesting new features to further enhance that ‘coding experience’. The most important one is probably the ‘batch refactoring’. With Batch Refactoring, specific refactoring actions can be performed on multiple objects in one go. As an example, NetBeans can help with the migration of Java code to Java 7, where migration means: making code benefit from enhancements available in Java 7. The available refactoring actions can be selected
the artifacts to refactor can be selected (this can be the entire project) and the refactor action can be started. NetBeans presents the results for review before they are applied:
and even more striking the use of a String argument in a switch statement – new in Java 7:
Another example of support better Java coding are the enhanced settings for managing Java Imports:
A feature that is frequently useful, especially for copy and paste operations, is a block (or column) select. NetBeans 7.1 introduces that option:
Maven 3 support
I have worked a little with NetBeans 7.0 and found the support for Maven truly valuable. In 7.1 this support apparently has been even further extended. In short what NetBeans can do is open projects based on a Maven pom.xml file. No additional project files are created or needed. The project is the pom.xml and the resources and subdirectories in the directory containing the pom file.
A new project can be created based on a Maven Archetype for a certain framework or type of project. By simply picking the archetype, the appropriate pom.xml file is created by Maven, integrated in NetBeans. All dependencies and the required goals are included. Getting a new project up and running has never been easier. My own experiences with the cometd + jQuery + Jetty archetype – that was not included in NetBeans and first had to be added – were amazing (I will shortly describe this in a follow up article).
Other new features in NetBeans 7.1 include better CSS 3.0 editing, integrated enhanced Git support and more features for PHP en C/C++ editing. I am sure there are many other smaller improvements that I have not spotted yet.
- Create simple Java application to post JSON message to CometD Bayeux Channel using Apache HttpClient and Maven style NetBeans project « AMIS Technology blog
- OOW13: summarizing one week and 2000 sessions in 3 hours and a bit – the yearly AMIS OOW Review session – 10th October
- JavaOne 2013: (Key) Notes of a conference – State of the Java platform and all the roadmaps
- Giving Java 8 a spin using NetBeans 7.4 RC
- 14 augustus – gratis seminar Oracle ADF 12c, JDeveloper 12c en WebLogic 12c revealed
- Java EE 7: EJB publishing CDI Events that are pushed over WebSocket to browser client
- Getting started with Java EE 7 – Hands on in 10 minutes
- Build and release OSB projects with Maven
- Kom kennismaken met AMIS en doe mee met uitdagende projecten
- JavaOne 2012: The Big Stories
- JavaOne 2012: Strategy and Technical Keynote