Friday Jan 30, 2009

Major Enhancement to NetBeans Platform's Window System

Toni Epple (from Eppleton, the Munich-based NetBeans Platform consultancy) already mentioned it in his blog yesterday: as a direct result of user requests, see below... is now possible to specify per-component (rather than only per-application, which has been possible since 6.5), whether a window should be closeable, maximizable, undockable, draggable, etc. As with so many new APIs in the past year or so, these changes are accompanied by ui improvements in the NetBeans Platform's SDK (i.e., NetBeans IDE), as can be seen below:

What then happens is that properties are added to the constructor, with the nice benefit that you can use code completion to work with them:

These changes are planned to be delivered with 7.0M2.

Free Video for Beginners to Wicket

Yesterday on I created a beginner's video for Wicket, today I uploaded a new version that includes callouts (i.e., texts in the screencast) during the demo section, to explain what's going on. It's now also shorter than before. Watch the whole thing ("Dummy's Guide to Wicket") here:
<script type="text/javascript" src=""></script> <script type="text/javascript"> </script>

Download it here!

I'm hoping to make other similar screencasts (which topics would you like? I'm thinking of "Dummy's Guide to Spring RCP" and "Dummy's Guide to Grails" and "Dummy's Guide to Griffon"), as well as finishing my "Top 10 NetBeans APIs" series, which needs 2 or 3 more parts before it will be complete. They will all be published on

Wednesday Jan 28, 2009

zembly: The Novel!

Somehow "Assemble the Social Web with zembly" landed on my desk about a week ago. The book is written by "award-winning authors" Gail & Paul Anderson, which entails that the content is well written & well constructed, together with two of the top Sun engineers in the web service space, Todd Fast & Chris Webster, who're also behind "zembly" itself, implying that the conceptual info & actual code is correct.

Sounds like a killer team to me.

I've blogged about zembly before (here), where I also mentioned Sang's related free on-line Zembly Basics course. My understanding (after having actually used it myself a bit, via Sang's course) is that zembly is an on-line development environment for social web applications, such as Facebook. I must say I thought it was quite fun. Sang's course is a brilliant intro.

The book I haven't read yet, but I flipped through it. My first impressions are that the book looks really nice and well structured, nice images, great layout. Also, the content is very practical. Here's the table of contents: 1. What is zembly?, 2. zembly Basics, 3. Building Flickr Widgets, 4. Building Zillow Widgets, 5. Facebook Basics, 6. Facebook Integration, 7. Working with Dapper, 8. Widget Gallery, 9. Building for the iPhone.

I find the last chapter especially interesting, because when I was in Egypt end of last year and did some presentations there, the professor at one of the universities had only one question (which he asked repeatedly): "I'd like to teach my students to develop for the iPhone. How do I get started? Is it even possible?" Well, the above chapter implies: "Yes!"

Looking forward to reading the book. Watch this space (or, more likely, for my full book review on this topic, in a few weeks.

Tuesday Jan 27, 2009

JavaFX vs. Visual Library

Yesterday I published an article about integrating JavaFX with the NetBeans Platform:

I think there are many use cases where using JavaFX on the NetBeans Platform would make sense, because it simplifies aspects of Swing coding.

What I'm wondering is, maybe it would be cool to clarify exactly how the NetBeans Visual Library differs from JavaFX. Obviously there are differences, but what are they concretely?

E.g., some random brainstorming:

  • JavaFX is focused on animation, effects, i.e., Flash-like behavior.
  • Visual Library is focused on modeling/representing/viewing data.
  • Visual Library is a widget library, each widget comes with predefined/customizable properties.
  • Visual Library integrates with NetBeans Platform idioms, such as Nodes and Explorer Views.
  • JavaFX has no special relationship with the NetBeans Platform, currently needs to be bolted on, same way as must currently be done for any Swing application.

They're very different, though both focused on graphic concerns.

To me, the million dollar question is: could JavaFX be integrated with the Visual Library? E.g., you'd use one of the widgets from the Visual Library and then add JavaFX juice for providing animations and special effects to that widget?

Monday Jan 26, 2009

Slide Deck Integrator Plugin for NetBeans IDE

I learned a bunch of interesting things today. It all started when I went back to the idea of documenting how I made the plugin that I'm using in the Top 10 NetBeans APIs series, for displaying my slides within NetBeans IDE. The problem is that I had lost my sources (also the binary, I think). But I needed to rewrite it anyway because I had hard coded the slides into the module.

So now, the slides are read from the layer.xml file! All one needs to do is (1) install my plugin, (2) create a new module that has nothing more than the standard NetBeans plugin metadata, plus a folder structure like this in the layer.xml file:

<folder name="Slides">
    <file name="Getting Started">
        <attr name="prefix" stringvalue="1"/>
        <attr name="iconLoc" stringvalue="org/bla/foo/icons/icon1.png"/>
        <attr name="position" intvalue="100"/>
        <attr name="slideLoc" stringvalue="org/bla/foo/slides/slide1.png"/>
    <file name="Lookup">
        <attr name="prefix" stringvalue="2"/>
        <attr name="iconLoc" stringvalue="org/bla/foo/icons/icon2.png"/>
        <attr name="position" intvalue="200"/>
        <attr name="slideLoc" stringvalue="org/bla/foo/slides/slide2.png"/>

Next, make sure to put icons and slides in the above places in the module. Even a completely non-technical person could prepare the above module, since there's not one character of code that needs to be typed. Then, (3), install the module providing the above layer.xml file into the same IDE as where my plugin (see step 1) is found.

My plugin will then read that folder (it looks within the "Slides" folder and then figures out what to do with the files and attributes you've registered) and presents a result like this:

However, even to a newbie NetBeans Platform developer, the approach I've taken is no news. What IS news is the content of the slide shown in the illustration above. (It is a slide by Jarda from the recent training he gave with Toni and Thomas in Linz.) So, from 7.0 onwards (and already in daily builds) you can use the above much simpler construction for accessing a resource in the System Filesystem.

The second newsworthy thing is the piece in bold below:

protected boolean createKeys(List keys) {
    FileObject slides = FileUtil.getConfigFile("Slides");
    FileObject[] kids = slides.getChildren();
    for (FileObject kid : FileUtil.getOrder(Arrays.asList(kids), true)) {
    return true;

By using FileUtil.getOrder, I am allowing the NetBeans Platform to use the "position" attribute in the layer.xml file for ordering the FileObjects, which is what lets me (without any coding, other than that small statement) ensure that the nodes are created in the correct order.

Unfortunately, I can't release my plugin yet because it uses the above constructions (as well as annotations in the TopComponents) which are not supported in 6.5. So, I'm on some daily build right now, which means the plugin will be incompatible soon. As soon as 7.0 M2 comes out, I'll make this available.

Potentially it could be used by NetBeans Platform Trainers—Toni would provide a module with the slides for his presentations, so would Jarda, I would provide my own presentations, and whoever else would do the same. Then I'd install all these modules and the slides would be merged into a single slide deck and could then be presented from inside the IDE as if they were all one set. Which is of course exactly the case. Thanks, System Filesystem, you rock.

Friday Jan 23, 2009

Cloud Computing in Plain English

Great movie.

Tuesday Jan 20, 2009

Status Report on The Year of Documented Business Scenarios

I hailed 2009 as the NetBeans Platform's "Year of Documented Business Scenarios", here in December last year. The related issue is here (feel free to hop into that issue and add your wisdom to it):

Well, I'm happy to report quite some progress. I started a series on NetBeans Zone a few days ago that you should definitely read closely if you're interested in a typical business case involving JPA on the backend with NetBeans view components on top (which is the main usecase described in the issue above):

However, note that I've ended up abandoning Beans Binding completely. Not sure if I'll have time to post the next installment of the series today, because I suddenly made a lot of progress that took up all my time. Below you see the current status (icons stolen from Tom's ToDoLIstManager, but everything else is mine), with, interestingly, the editor component (currently view mode only) and the tree structure being in two separate modules (anything else would have not been a correct NetBeans Platform idiom):

Despite being in separate modules (enabling either one to be removed and replaced by an alternative module that fits into the flow), the two components are perfectly synchronized. The separation between editor and view is done exactly as described in Tim's tutorial. Several issues need to be looked at very closely still, especially in relation to optimizing the JPA and EntityManager parts. However, a lot of the coding is done, at least for the view side of things. Next, I will need to look at how to store the data back to the database via JPA. (Any tips on this would be welcome.) I imagine "SaveCookie" is going to be playing a big role here, which I will need to hook up to the EntityManager. I'll be looking at Tom's "SaveCookie" for sure, though he doesn't use a database.

Once the whole scenario is complete, and I have completed my series on NetBeans Zone, I will turn the whole scenario into a tutorial on the NetBeans Platform Tutorials page. After that, it would be cool to create a code generator that will generate the whole application from a given database, exactly as is done for JSR-296 in NetBeans IDE.

Friday Jan 16, 2009

Bye Alex And Various Random Technology Thoughts from Egypt

It was not until yesterday, after having spent a month in Alexandria, Egypt, that I remembered the high school I went to in Pietermaritzburg, South Africa, was called 'Alexandria Boys High School' (which at the time was for white boys only, both of which are no longer true). But the school was named after some princess while Alex in Egypt is named after Alexander the Great, who founded it. Unless I miss my early morning plane, I'll be back in Prague during the weekend. Aside from the scuba diving I did here (did you know there are, among many other things, an Italian warplane, the ancient Egyptian lighthouse, four headless Sphinxes, and Cleopatra's red granite table at the bottom of the Alexandrian harbor, all at under 10 meters?), and the general hanging out, and the daily slog through Arabic conjugations (hey, I passed my exam, hurray), I came across (and participated in) a remarkable number of different Java-related things in Egypt:
  • Cairo NetBeans Platform Training. I delivered a full-blown NetBeans Platform Training in Cairo. Here's the announcement and here's a report. It was the largest group of students at any NetBeans Platform Training held thus far (50+), plus most were teachers themselves, or worked within commercial companies. Just imagine if the training were held while students are not preparing for their exams (which is why they didn't attend). I'm expecting we'll see quite a bit of further development (and, potentially, some of them turning into NetBeans Platform Trainers themselves) by those who attended this course. Watch this space.

  • El Menoufiyeh NetBeans Presentations. Earlier, I did two hours of presentations at El Menoufiyeh University. (Read about it here, then read all the comments to see the enthusiasm with which the presentations have been received, indicating massive potential there and elsewhere.) In addition to all the hallmarks of NetBeans IDE (Matisse, JSF CRUD Generator, GlassFish integration, etc), I also presented JavaFX, Groovy, Grails, and Wicket, which were all new to the students, who were mostly in their 2nd year of university. (Hamada and the students gave me a very nice party afterwards and a Pharaonic bust that will take pride of place on my desk in Prague when I get back there.)

  • NetBeans Platform Project at Suez Canal University. I met Ahmed Gaber and another student from Suez Canal University (cool name for a university) in Ismailia, who are in a team of 10 students creating a visual database generator on the NetBeans Platform. Read about it here. Potentially, they could end up working on their project in tandem with the database engineers on the NetBeans team, but that is still under discussion. (Ahmed also created a new Shisha plugin for NetBeans IDE, which I will blog about separately, soon.) By the way, those two students traveled 5 hours to visit me in Alex and left me with a shoebox full of great biscuits from Ahmed's mother.

  • Ofok. I spent a great day with Moataz and Mohab from Ofok (which means "Horizon") in Cairo. (They took me on a tour of the Mohammed Ali mosque, among others, and museums that are all found in a cluster together, guided by their friend Mustafa who is an architecture lecturer at the university, so a perfect tour guide who knew everything about everything.) Ofok is a Sun partner aimed at popularizing open-source tecnhnologies in Egypt. They specifically mentioned they're offering Ubuntu and OpenSolaris as part of their package. They have a training center in Cairo, which I visited, including two labs where they hold their trainings. Hopefully next time I'm there I'll be able to hold a NetBeans Platform Training with them, which we've discussed as flowing nicely from Java SE trainings. I'd like to interview them for an upcoming NetBeans Podcast, because they're doing some really cool open-source things that people need to know about.

  • Dental Application on the NetBeans Platform. Ahmed Ramadan, one of the students on the Cairo NetBeans Platform Training, is porting his dental application to the NetBeans Platform. For his degree, he's creating this application which dentists can use to analyze teeth and figure out how to fix them. It has a lot of graphic-related functionality and it is already far enough along in the porting process for Ahmed to demonstrate the advantages of doing so, which he did during the course, on the final day. Is there a better way of demonstrating the usefulness of the NetBeans Platform than having someone who is in the process of using it demonstrate its applicability?

  • JavaLobby Interviews. For JavaLobby, I did two interesting interviews about local development stuff. Firstly, I interviewed Amr ElDawy (here) about his JSPX web framework, then I interviewed Mohammed Ali and Ehab ElBadry from eSpace about their switch from Java to Ruby (here). I probably only touched the tip of the iceberg, though. (Here's an interesting statistic: after Amr's interview was published he wrote me with these words: "After publishing the interview yesterday the number of hits on the project website increased massively. The number of countries visited the website have now increased from 18 to more than 46. and all this just in hours.") Hopefully I'll be able to meet more companies or individual developers another time. (ITWorx, "the largest software professional services firm in Egypt", was a company I was arranging to visit but never did and I owe Ahram Canadian University a presentation on the NetBeans Platform, thanks to Tarek (who is a sky diver) from the Cairo NetBeans Platform course.)

  • Ministry of Communications and Information Technology (MCIT). I had a very interesting discussion, thanks to Ahmed Ramadan who I mentioned above, with a consultant attached to the MCIT (i.e., a governmental department). He said they're extremely interested in open-source solutions and would welcome Sun presentations on this topic. Future visits to Egypt could include full-blown presentations to the MCIT on OpenOffice, GlassFish, NetBeans, OpenSolaris, et al.

  • Ahmed Hashim & Hamada Zahera. None of the above would have been possible without Ahmed from the Egyptian JUG (after the government consultant mentioned above, Ahmed is the most well-connected person on the IT-front you're likely to meet in Egypt, read an interview with him here, on the state of Java et al in Egypt) and the uber-enthusiastic Hamada from El Menoufiyeh. Thanks for everything and hope to see you again soon!

In general, I can confidently conclude that Sun's hardware focus in Egypt is accrueing a great expense—while in the software world Oracle, IBM, and Microsoft are massive here, Sun is almost non-existent. (I could almost say that Java is being adopted here, if at all, not because of, but despite, Sun.) Especially now that Egypt has officially entered Gartner's top 30 countries for out-sourcing (read here for evidence), for example, while simultaneously being a country that is the main driver in the Middle East in terms of the number of IT-related graduates graduating per annum, and similar indicators showing Egypt's leading position in this part of the world when it comes to technology, though simultaneously being part of a pretty poor part of the world... one would think the opportunities for open-source here are massive. However, .Net still leads significantly in popularity over Java, which I believe can be attributed to the strength of aforementioned companies here versus the weakness of Sun. (On the other hand, what chance does any alternative to Windows have while most (all?) computers come pre-installed with Windows? When I got my new laptop, my first step was to uninstall Windows, then install Ubuntu, then, much later, install OpenSolaris via VirtualBox. But how many end users are seriously going to make that effort, when the benefit to end users is marginal if at all? Isn't there a case to be made for Microsoft having an unfair advantage via its preinstalled distributions?) Here's some more interesting reading. Summing up this bit, I'd say Egypt should not be considered a backwater in technology, anymore, assuming it was ever correct to hold that opinion.

Plus, take a look at the list above and see how many times "NetBeans Platform" is mentioned. Seems to me a big deal of money could be made from that product, bearing in mind that most of the encounters above fell in my lap without my even trying. Just imagine what could happen if a little bit of structured focus were to be placed on that Sun technology in terms of money-making potential. (FYI, the NetBeans Platform is a Swing desktop application framework empowering and simplifying the development process of Swing desktop applications as well as, as can be read here, modular web applications.)

The personal highlights of my trip were (1) all of the above, (2) watching a real Arabic movie in the cinema (with a friend whispering translations in my ear every 5 minutes, which was about the time it took for me to lose the plot), (3) getting a genuine Palestinian scarf from a Palestinian guy I met in the market in Cairo and who I hung out with later in Alex (who is the 26th of 28 children, which was an interesting discussion). Some more cool things were reading "Antony & Cleopatra" from scratch right after diving around artifacts that they might personally have held, checking out Cavafy's apartment which is now a museum, as well as reading Evelyn Waugh for the first time, which is kind of odd to read in Egypt. Interesting encounters included one with a full-blown Holocaust denier, a long night in a club in Cairo, and very many small attempts at exercising my rather poor Arabic. (Thanks to the dozens of fake-watch vendors in Alex, I can now say 'I already have a very beautiful watch' in fluent Arabic in my sleep.)

It's been a very cool time in Alex and I hope to be back later this year.

Tuesday Jan 06, 2009

NetBeans Shisha Integration

One of the top 10 features of Egypt is, of course, the shisha (more specifically, the contents thereof). Here is me last night outside a cafe in Cairo with Hamada, Amr, and Khaled, applying the default shisha usecase:

The discussion obviously turned to the need for tight integration between shisha and NetBeans IDE. Initial brainstorms around powering NetBeans IDE via a shisha were briefly assessed and then rejected as brilliant but impractical. Then, as if out of thin air, the concept of a NetBeans plugin for shishas was born. Here is a first implementation—shisha cursor:

package org.netbeans.shisha;

import java.awt.Cursor;
import java.awt.Image;
import java.awt.Point;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import org.openide.modules.ModuleInstall;

public class Installer extends ModuleInstall {

    public void restored() {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                //Create the cursor:
                Toolkit tk = Toolkit.getDefaultToolkit();
                ImageIcon shishaImageIcon = new javax.swing.ImageIcon(getClass().getResource("/org/netbeans/shisha/shisha.png"));
                Image shishaImage = shishaImageIcon.getImage();
                Cursor shishaCursor= tk.createCustomCursor(shishaImage, new Point(10,10), "Shisha");
                //Use the cursor in the main window:
                JFrame frame = (JFrame) WindowManager.getDefault().getMainWindow();


And this is how the source structure looks, together with the shisha cursor installed into the IDE:

Even tighter integration can be achieved by setting the shisha cursor in the editor too, by changing the caret to use the same icon. Further steps could involve extending the Options window with a selection of different shishas from which the user can select their preferred model. In this case, unfortunately, the content thereof is irrelevant.

Sunday Jan 04, 2009

Cairo on the NetBeans Platform!

Today was day two of a three day NetBeans Platform Training in Cairo. The training is being held at the University of Cairo, but many of the students are from many other places—and most are either from software companies creating desktop applications or are teachers from universities and colleges. The course was organized via the Egyptian JUG, where you can find more pics (here).

Here's a pic of part of the group at the end of the 1st day:

The program of the course is as follows:

  • Day 1:
    • Getting Started with the NetBeans Platform
    • Lookup API
    • System FileSystem API
  • Day 2:
    • Window System API
    • Nodes API and Explorer & Property Sheet API
    • Visual Library API
  • Day 3:
    • Extending NetBeans IDE
    • Other Interesting NetBeans APIs
    • Ideas for Modules

I think this three day structure is much better than our normal two day course. But, maybe, sometime in the future, we could hold a workshop oriented course here, which would build on top of this one. It could take 5 days and at the end the students would have a complete application on top of the NetBeans Platform.

Interested in becoming trained to use the NetBeans Platform too? Write to users AT edu DOT netbeans DOT org. Especially schools, colleges, and universities interested in integrating this course into their standard curriculum are encouraged to invite us along: we'll come for free, depending on where you're located. NetBeans Platform trainers are found in many parts of the world, as you can read here on NetBeans Zone. And maybe you'd like to become a NetBeans Platform trainer too?

Saturday Jan 03, 2009

"NetBeans greatly simplifies plugin development" -- Jeff Friesen

Jeff Friesen (whose great book "Beginning Java SE 6 Platform: From Novice to Professional" I reviewed here on Javalobby) has written a great article, freshly published in JavaWorld:

The last sections of the article show you how to create a NetBeans plugin from scratch. These sections are prefaced by these words, which I thought were quite nice: "After trying out the previously discussed NetBeans plugins and others that you download from the NetBeans Plugins Portal, you'll probably want to create your own. If you're new to this task, you might find it somewhat intimidating. Fortunately, NetBeans greatly simplifies plugin development."

Go read it, right now!


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.


« January 2009 »