Geertjan's Blog

  • October 28, 2007

Groovy on the NetBeans Platform?

Geertjan Wielenga
Product Manager
Using the script referred to yesterday, with some modifications by Bernhard (see the comments in yesterday's blog entry), I added a JFrame, which feeds the values to the Groovy script as follows:

Scanner scanner = new Scanner();
scanner.scan(folderField.getText(), extField.getText(), searchField.getText());

The lines above are everything that is found in searchButtonActionPerformed. And here's the result, showing the source structure, running application, and output in the IDE's Output window:

And then I generated some Groovydoc, which clearly shows that my Groovy and Java are equal partners (since, in fact, they're both Java):

Well, this is all obvious since, as Jeremy Rayner says in his Javalobby interview, "Groovy is just an implementation detail of your Java APIs". In this context, I'm seeing Groovy more as a programming style than a separate language. In the same way as you can choose to use generics, if you like, or not, you can choose to use Groovy, or not. But at the end of the day you'll still have Java and your user will not care whether you've used generics or whether you've used Groovy. It's just an implementation detail.

Next, it would be interesting to port this to the NetBeans Platform. Is there anyone out there who is using Groovy on the NetBeans Platform? That would be a cool thing to play with and should be completely possible.

Join the discussion

Comments ( 3 )
  • Alex Kotchnev Sunday, October 28, 2007


    I've played around with the ability to script NetBeans using groovy as a way of learning the platform itself. Basically, I had a module that had access to pretty much all APIs in the platform, then added groovy-all.jar as a library. Then, when you load this module in the IDE and have that module fire up a console, that console has full access in order to script the platform (and learn about it).

  • Tom Wheeler Sunday, October 28, 2007

    I am using Groovy on the NetBeans Platform.

  • Ramon Tuesday, October 30, 2007


    can we have access to that module?

    One could also think about implementing something like this:


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.