Wednesday Oct 10, 2012

"Well, Swing took a bit of a beating this week..."

One unique aspect of the NetBeans community presence at JavaOne 2012 was its usage of large panels to highlight and discuss various aspects (e.g., Java EE, JavaFX, etc) of NetBeans IDE usage and tools. For example, here's a pic of one of the panels, taken by Markus Eisele:

Above you see me, Sean Comerford from ESPN.com, Gerrick Bivins from Halliburton, Angelo D'Agnano and Ioannis Kostaras from the NATO Programming Center, and Çağatay Çivici from PrimeFaces. (And Tinu Awopetu was also on the panel but not in the picture!)

On one of those panels a remark was made which has kind of stuck with me. Henry Arousell, a member of the "NetBeans Platform Discussion Panel", who works on accounting software in Sweden, together with Thomas Boqvist, who was also at JavaOne, said, a bit despondently, I thought, the following words at the start of the demo of his very professional looking accounting software: "Well, Swing took a bit of a beating this week..."

That remark comes in the light of several JavaFX sessions held at JavaOne, together with many sessions from the web and mobile worlds making the argument that the browser, tablet, and mobile platforms are the future of all applications everywhere. However, then I had another look at the list of Duke's Choice Award winners:

http://www.oracle.com/us/corporate/press/1854931

OK, there are 10 winners of the Duke's Choice Award this year. Three of them (JDuchess, London Java Community, Student Nokia Developer Group) are not awards for software, but for people or groups. So, that leaves seven awards. Three of them (Hadoop, Jelastic, and Parleys) are, in one way or another, some kind of web-oriented solution, though both Hadoop and Jelastic are broader than that, but are service-oriented solutions, relating to cloud technologies.

That leaves four others: NATO air defense software, Liquid Robotics software, AgroSense software, and UNHCR Refugee Registration software. All these are, on the software level, Java desktop solutions that, on the UI layer, make use of Java Swing, together with LuciadMaps (NATO), GeoToolkit (AgroSense), and WorldWind (Liquid Robotics). (And, it went even further than that, i.e., this is not passive usage of Swing but active and motivated: Timon Veenstra, during his AgroSense demo, said "There are far more Swing applications out there than we seem to think. Web developers just make more noise." And, during his Liquid Robotics demo, James Gosling said: "Not everything can be done in HTML.")

Seems to me that Java Swing was the enabler of more Duke's Choice Award winners this year than any other UI-oriented Java technology. Now, I'm not going to interpret that one way or another, since I've noticed that interpretations of facts tend to validate some underlying agenda. Take any fact anywhere and you can interpret it to prove whatever opinion you're already holding to be true.

Therefore, no interpretation from me. Simply stating the fact that Swing, far from taking a beating during JavaOne 2012, was a more significant user interface enabler of Duke's Choice Award winners than any other Java user interface technology. That's not an interpretation, but a fact.

Tuesday Oct 09, 2012

JEditorPane Code Completion (Part 1)

Code completion in a JEditorPane:

Unfortunately, a lot of this solution depends on the Java Editor support in the IDE. Therefore, to use it, in its current state, you'll need lots of Java Editor related JARs even though your own application probably doesn't include a Java Editor.

A key thing one needs to do is implement the NetBeans Code Completion API, using the related tutorial in the NetBeans Platform Learning Trail, but register the CompletionProvider as follows:

@MimeRegistration(mimeType = "text/x-dialog-binding", service = CompletionProvider.class)

Then in the TopComponent, include this code, which will bind all the completion providers in the above location, i.e., text/x-dialog-binding, to the JEditorPane:

EditorKit kit = CloneableEditorSupport.getEditorKit("text/x-java");
jEditorPane1.setEditorKit(kit);

FileObject fob;
try {
    fob = FileUtil.getConfigRoot().createData("tmp.java");
    DataObject dob = DataObject.find(fob);
    jEditorPane1.getDocument().putProperty(
            Document.StreamDescriptionProperty,
            dob);
    DialogBinding.bindComponentToFile(fob, 0, 0, jEditorPane1);
    jEditorPane1.setText("Egypt");
} catch (IOException ex) {
    Exceptions.printStackTrace(ex);
}

Not a perfect solution, a bit hacky, with a high overheard, but a start nonetheless. Someone should look in the NetBeans sources to see how this actually works and then create a generic solution that is not tied to the Java Editor.

Update. Part 2 simplifies and corrects this blog entry.

Monday Oct 08, 2012

YouTube: Programming for Blind & Visually Impaired Developers?

A brand new video (published today) of the 2012 Blind and Visually Impaired computer Programming (BVIP 2012) camp at the Washington State School for the Blind.

In this video, teachers and students are highlighted learning to write computer software using the Sodbeans IDE, a derivative of NetBeans IDE, together with the Quorum programming language.

Sunday Oct 07, 2012

Android Layout Preview for NetBeans IDE

More often than not, the reason that Eclipse has more plugins than NetBeans IDE is because Eclipse has far less features out of the box. For example, thanks to its out of the box support, NetBeans IDE doesn't need a Maven plugin and it doesn't need a Java EE plugin, which are two of the most popular plugins for Eclipse.

However, what would be great for NetBeans IDE to have is support for Android. It's existed for a while, thanks to the community-driven NBAndroid project, but without much desired GUI functionality. Today, the project announced a leap forward, that is, early results in providing a layout preview:

Looking forward to more GUI functionality for this project!

Saturday Oct 06, 2012

Test JPQL with NetBeans IDE 7.3 Tools

Since I pretty much messed up this part of the "Unlocking Java EE 6 Platform" demo, which I did together with PrimeFaces lead Çağatay Çivici during JavaOne 2012, I feel obliged to blog about it to clarify what should have happened! In my own defense, I only learned about this feature 15 minutes before the session started. In 7.3 Beta, it works for Java SE projects, while for Maven-based web projects, you need a post 7.3 Beta build, which is what I set up for my demo right before it started. Then I saw that the feature was there, without actually trying it out, which resulted in that part of the demo being a bit messy. And thanks to whoever it was in the audience who shouted out how to use it correctly!

Screenshots below show everything related to this new feature, available from 7.3 onwards, which means you can try out your JPQL queries right within the IDE, without deploying the application (you only need to build it since the queries are run on the compiled classes):

SQL view:

Result view for the above:

Here, you see the result of a more specific query, i.e., check that a record with a specific name value is present in the database:

Also note that there is code completion within the editor part of the dialog above. I.e., as you press Ctrl-Space, you'll see context-sensitive suggestions for filling out the query. All this is pretty cool stuff! Saves time because now there's no need to deploy the app to check the database connection.

Friday Oct 05, 2012

Gradle in NetBeans IDE 7.3 Beta

Installed Attila Kelemen's Gradle plugin in NetBeans IDE 7.3 Beta today:

http://plugins.netbeans.org/plugin/44510/gradle-support

Not only can existing Gradle projects now be opened, i.e., any folder with a build.gradle file:

...but single Gradle projects as well as multi module Gradle projects can be created:

What you see below is the result of using the "Gradle Root Project" template once, followed by the "Gradle Subproject" twice within the folder where the root project was created:

Pretty cool stuff. Where's the documentation for the plugin? Here:

https://github.com/kelemen/netbeans-gradle-project

Read it, some handy tips and tricks are provided there.

Thursday Oct 04, 2012

"Yes, but that's niche."

JavaOne 2012 has come to an end though it feels like it hasn't even started yet! What happened, time is a weird thing.

Too many things to report on. James Gosling's appearance at the JavaOne community keynote was seen, by everyone (which is quite a lot) of people I talked to, as the highlight of the conference. It was interesting that the software for the Duke's Choice Award winning Liquid Robotics that James Gosling is now part of and came to talk about is a Swing application that uses the WorldWind libraries. It was also interesting that James Gosling pointed out to the conference: "There are things you can't do using HTML."

That brings me to the wonderful counter argument to the above, which I spend my time running into a lot: "Yes, but that's niche." It's a killer argument, i.e., it kills all discussions completely in one fell swoop. Kind of when you're talking about someone and then this sentence drops into the conversation: "Yes, but she's got cancer now."

Here's one implementation of "Yes, but that's niche":

  • Person A: All applications are moving to the web, tablet, and mobile phone. That's especially true now with HTML5, which is going to wipe away everything everywhere and all applications are going to be browser based.

  • Person B: What about air traffic control applications? Will they run on mobile phones too? And do you see defence applications running in a browser? Don't you agree that there are multiple scenarios imaginable where the Java desktop is the optimal platform for running applications?

  • Person A: Yes, but that's niche.

Here's another implementation, though it contradicts the above [despite often being used by the same people], since JavaFX is a Java desktop technology:

  • Person A: Swing is dead. Everyone is going to be using purely JavaFX and nothing else.

  • Person B: Does JavaFX have a docking framework and a module system? Does it have a plugin system?  These are some of the absolutely basic requirements of Java desktop software once you get to high end systems, e.g., banks, defence force, oil/gas services. Those kinds of applications need a web browser and so they love the JavaFX WebView component and they also love the animated JavaFX charting components. But they need so much more than that, i.e., an application framework. Aren't there requirements that JavaFX isn't meeting since it is a UI toolkit, just like Swing is a UI toolkit, and what they have in common is their lack, i.e., natively, of any kind of application framework? Don't people need more than a single window and a monolithic application structure?

  • Person A: Yes, but that's niche.

In other words, anything that doesn't fit within the currently dominant philosophy is "niche", for no other reason than that it doesn't fit within the currently dominant philosophy... regardless of the actual needs of real developers. Saying "Yes, but that's niche", kills the discussion completely, because it relegates one side of the conversation to the arcane and irrelevant corners of the universe. You're kind of like Cobol now, or something like a wacky cartoon character at a party for grown ups, as soon as "Yes, but that's niche" is said. What's worst about "Yes, but that's niche" is that it doesn't enter into any discussion about user requirements, i.e., there's so few that need this particular solution that we don't even need to talk about them anymore.

Note, of course, that I'm not referring specifically or generically to anyone or anything in particular. Just picking up from conversations I've picked up on as I was scurrying around the Hilton's corridors while looking for the location of my next presentation over the past few days. It does, however, mean that there were people thinking "Yes, but that's niche" while listening to James Gosling pointing out that HTML is not the be-all and end-all of absolutely everything.

And so this all leaves me wondering: How many applications must be part of a niche for the niche to no longer be a niche? And what if there are multiple small niches that have the same requirements? Don't all those small niches together form a larger whole, one that should be taken seriously, i.e., a whole that is not a niche?

About

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.

Search

Archives
« October 2012 »
SunMonTueWedThuFriSat
 
1
2
3
21
   
       
Today