Friday Feb 28, 2014

"NetBeans Platform for Beginners" is a Leanpub Bestseller

I heard from its authors that "NetBeans Platform for Beginners" is selling really well. If you look at the Leanpub Bestsellers page, you'll see it's second in "earnings in last 7 days". And the reviews are really good, too, for example, here's a review from a newbie to the NetBeans Platform:

And here's the review of a very experienced NetBeans Platform developer:

And there's a growing list of other reviews at the bottom of the book page, check it out, also from Benno Markiewicz and Michael Bishop. 

Would be great to support this wonderful effort by... writing reviews of it and blogging about it too. I'm going to send them (walternyland@yahoo.com) a review of the book, so that they can add it to the great set of reviews they have there already. Will you too, whoever you are reading this blog? Small and useful weekend task in support of the NetBeans community.

Wednesday Feb 26, 2014

Top 5 Features of NetBeans 8

The release candidate for NetBeans 8 is available.

The top 5 features of the release

  • Tools for Java 8 Technologies. Especially code analyzers and converters for moving to lambdas, functional operations, and method references, as well as one-click deployment and profiling for IoT, i.e., on embedded devices, such as Raspberry Pi.

  • Tools for Java EE Developers. Here the focus is on out of the box PrimeFaces application and artifact generators. End to end development of Java EE applications, from code generators to Java editor enhancements supporting PrimeFaces developers. In addition, there's TomEE support for the first time, and the new WildFly plugin by Red Hat guys.

  • Tools for Maven. Maven is really the key feature of NetBeans IDE, since it is the meeting point of so many different technologies and tools. No plugins needed in NetBeans IDE for this, just open the folder containing your POM and the IDE does the rest, defining the project in the IDE completely from your POM.

  • Tools for JavaScript. Lots of love for AngularJS in NetBeans 8, especially focused on connecting model, controller, and view classes with each other via code completion and hyperlinks.

  • Tools for HTML5. Grunt and Karma out of the box!

Also, many other enhancements, and new tools, for PHP developers and C/C++ developers too.

For more details, see The top 5 features of NetBeans IDE 8 on JAXEnter.com.

Tuesday Feb 25, 2014

Big Day for the NetBeans Platform

Obviously today is a very big day for the NetBeans Platform and all its users around the world. Two new books have been published on Leanpub especially for users of the NetBeans APIs. (To understand what Leanpub is all about, watch this YouTube introduction.)

In the first book, which is a completed book on Leanpub, entitled "NetBeans Platform for Beginners" (361 pages!), the authors take you on a walk through all the key NetBeans APIs, together with many example exercises and a free set of samples available on GitHub, with an open discussion forum included. You'll be creating well architected and pluggable Java desktop applications before you're even fully aware of what you're doing.

What strikes me about this book is that it gives a very good weighting of the value of particular features of the NetBeans Platform. I.e., instead of spending pages and pages explaining things you don't actually need to know, it splits topics into sections entitled "Basic" and "Advanced". In that way you know the importance or the priority of the topics you're learning about. That's something I've missed in other books on the NetBeans Platform. For example, only very rarely do you need to use the CallbackSystemAction, hence that topic is stuck away in an advanced section, instead of confronting you with it right at the start of the Actions chapter.

By the end of the book, you'll have a really thorough understanding of what the NetBeans Platform wants to do for you and how your application maps to its idioms. 

The second book is, if anything, even more interesting. Its value proposition lies in your involvement with its writing. It is not a complete book. It is called "Exercises in Porting to the NetBeans Platform" and is far more in line with the intentions of Leanpub than the book above. The idea of Leanpub is that you should be publishing a book early and often, (and not only after page 361 like the book above). Like continuously. As soon as something is ready, it should be published, where "ready" means the first or second chapter is enough info for the reader to want to get started with it, like a serial novel.

In this particular case, it is the hope of the authors that readers get involved. Contribute small example applications that encompass a problem you're facing in porting to the NetBeans Platform. Then the authors will dedicate the next chapter of their book to your problem scenario.

The first chapter is also available for free to give you an idea of the aims of the book. It shows a small JSplitPane application, together with an outline of how to move it to NetBeans Platform idioms, together with free source code available on GitHub. The value of this book is that it shows you how to think in terms of NetBeans Platform idioms, i.e., it applies all the principles of the first book to porting scenarios that can easily be followed and learned from. On the feedback page of the second book, tell the authors what scenario the next chapter of the book should focus on.

All in all great news for the NetBeans Platform. Really comprehensive texts for getting started, also available bundled together at a reduced price as a "NetBeans Platform Starter Kit". 

Anyone out there read it and have opinions to share? Some pretty positive reviews are already available on the page, by Benno Markiewicz, Donald A. Evett, Michael W. Bishop, and Sean Phillips.

Monday Feb 24, 2014

Of Toolbars and Banners

From some code by Djamel Torche, here's how to create a toolbar along the left side of the NetBeans Platform.
@OnShowing
public class Startable implements Runnable {
    @Override
    public void run() {
        addToMainWindow();
    }
    public void addToMainWindow() {
        Frame mainWindow = WindowManager.getDefault().getMainWindow();
        Container contentPane = ((JRootPane) mainWindow.getComponents()[0]).getContentPane();
        JToolBar toolbar = new JToolBar();
        toolbar.setFloatable(false);
        toolbar.setLayout(new BoxLayout(toolbar, BoxLayout.Y_AXIS));
        addButtons(toolbar);
        toolbar.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
        contentPane.add(BorderLayout.WEST, toolbar);
    }
    private void addButtons(JToolBar panel) {
        for (Action a : Utilities.actionsForPath("Toolbars/Clipboard")) {
            JButton button = new JButton(a);
            Mnemonics.setLocalizedText(button, a.getValue(Action.NAME).toString());
            panel.add(button);
        }
    }
}

And if you want a banner along the top of the NetBeans Platform, one that can't be moved, one that doesn't resize, one that can't be closed, simply use the code above and change BorderLayout.WEST to BorderLayout.NORTH. And/or change JToolBar to JPanel.

Thursday Feb 20, 2014

Terence "ANTLR Guy" Parr Invitation!

Terence Parr, awesome superhero language guru guy and definitely related somehow to Jim Carrey, as well as being the author of one of the best blog entries ever written Report of GUI's death greatly exaggerated, has an important announcement to make and here it is:
Calling all coders that love to discuss computer language design and implementation! Whether you're functional, imperative, or declarative come hang out for open discussion, lightning talks, and some formal talks.

Meet other language geeks and get some socialization! Experts and beginners are welcome. You might learn, teach, eat, or drink something.

Your fearless leader is all around nice guy and supreme dictator for life Terence Parr, The ANTLR and StringTemplate Guy. I will moderate the discussions to avoid too many food fights and dampen non-Terence loudmouths. Interest level will dictate location in San Francisco (e.g., coffee shop, bar, university lecture room, industry meeting room, etc...).

For fun, I might even take the show on the road to tech spots like Seattle, Bangalore, or Superman's hideout at the North Pole.

http://www.meetup.com/SF-Computer-Language-Design-and-Implementation/

The first event Thursday, March 6, 2014 at 19.00 in San Fran:

http://www.meetup.com/SF-Computer-Language-Design-and-Implementation/events/166177232/ 

Tuesday Feb 18, 2014

Interview with Authors of "NetBeans Platform for Beginners" (Part 2)

In part 1, Jason Wexbridge and Walter Nyland were interviewed about the book they're working on about the NetBeans Platform.

https://leanpub.com/nbp4beginners

I caught up with them again, in the final stages of working on their book, to ask them some questions.

Hi Jason and Walter, how are things going with the book?

Jason: Great. Really finishing touches time, at this point.

Walter: It's been an intense time, but we're coming to the end of it now.

It's not a pamphlet, then?

Walter: Indeed not. We're currently at page 350 and it looks like we'll end up with around 370 pages or so. It's a lot of code, a lot of samples, a lot of detailed instructions for making the most of the many solutions and components that the NetBeans Platform provides.

Jason: We've had a lot of help from several people in the NetBeans community, in terms of review comments and insights, such as from Benno Markiewicz and Michael Bishop, while Sean Phillips is also involved now. In addition, some newbies just starting out with the NetBeans Platform are also reviewing early versions of the book. In total, we have about 5 reviewers at this point, which has been immensely beneficial in helping us position the content of the book correctly.

What do you consider to be the highlights of the book?

Walter: Well, to me, the highlight is that it is exactly the book I would have wanted to have when I started working with the NetBeans Platform.

Jason: Right, that's the book we wanted to write. It genuinely aims to provide complete solutions and understandings of all the core topics, that is, module system, file system, window system, action system, nodes, explorer views, visual library, palette, project system, and a long list of miscellaneous topics, such as dialogs and wizards.

What about JavaFX? Source editor? Maven?

Jason: Out of scope for the current book, though definitely the focus of the books we'll be working on next.

Wow, awesome news. Great work. Any final thoughts?

Walter: Please simply click this link and sign up to the book, just tell us how much you think would make sense for us to charge for it, based on the two interviews we've now given, and the sample that can be downloaded there. And when you leave your e-mail address, you'll be informed as soon as we publish the book!

https://leanpub.com/nbp4beginners

Many thanks, Jason and Walter! And, NetBeans Platform developers out there, please support this great effort by going to the site above and reading the PDF, leaving comments for Jason and Walter, and by telling them how much you'd pay for the completed book.

Monday Feb 17, 2014

Embedded Development with Lua in NetBeans

Lua is intended to be embedded into other applications. One hears a lot of buzz around it in the context of embedded development. Since recently, the team providing the professional Lua Glider have made a subset available as a free extension to NetBeans IDE, consisting of an editor, debugger, and profiler.


Download and install it here:

http://plugins.netbeans.org/plugin/52786/lua-glider-netbeans-edition

And here's a tutorial I've been using to learn Lua.

Friday Feb 14, 2014

Visual Database Modeling in NetBeans

There's an extremely interesting and professional new plugin, by Gaurav Gupta, who also created the really nice JBPM tools for NetBeans recently. It's a modeling tool that lets you generate Java classes from diagrams such as this:


Get it here and see the explanatory screenshots on the page: http://plugins.netbeans.org/plugin/53057/jpa-modeler

Thursday Feb 13, 2014

Seamless Aspose Integration with NetBeans IDE

Aspose makes file format APIs and components available in multiple languages and for various technologies, including Java.

Recently the Aspose team made a great plugin available to the NetBeans community as a way to highlight their technology. Go to Tools | Plugins and you'll find the Aspose plugin available, while it is also on the NetBeans Plugin Portal, where it is described too.

You'll find a new project template in the Java category in the New Project dialog:

On the next step, you specify the name of the project and when you click Next again you're able to access Java libraries from the Aspose site:

That, in turn, creates the project below, adding the JARs from Aspose to the classpath:

Then you can go to the New File dialog and you'll see "Aspose Example" in the Java category:

Now you can choose from heaps of Aspose samples:

For example, now I have code for creating e-mails via the Aspose solution for doing so:

Congratulations for creating such seamless integration with NetBeans IDE, Aspose team! Aspose is now included on the NetBeans Partner page:

https://netbeans.org/community/partners/

Wednesday Feb 12, 2014

New NetBeans Book by Oracle Press

Build and distribute business web applications that target both desktop and mobile devices.

Cowritten by Java EE and NetBeans IDE experts, "Java EE and HTML5 Enterprise Application Development" fully explains cutting-edge, highly responsive design tools and strategies.

Find out how to navigate NetBeans IDE, construct HTML5 programs, employ JavaScript APIs, integrate CSS and WebSockets, and handle security.

This Oracle Press guide also offers practical coverage of SaaS, MVVM, and RESTful concepts.

Tuesday Feb 11, 2014

Two Recent IDE Polls -- Odd Similarities

Over the years, in this blog, I have frequently questioned the difference between data and information. All the way back in 2008, I even discussed statistics in the context of (my childhood hero) John McEnroe. How many out there can claim to have been arguing about statistics consistently and coherently for as long as I have? Indeed, not many.

Data is numbers, graphs, statistics, ups, downs, etc. Meanwhile, information is the meaning of data, that is, the conclusions that can be drawn from it.

What does it mean that the statistics over the past month show, both on jaxenter.de AND on java.net that NetBeans IDE is (in the case of jaxenter.de) the best IDE and (in the case of java.net) the IDE in which most coding is done?

In both cases, interestingly, more votes were cast in the polls above than in other recent polls on those sites which signifies, surely, that there is more passion around this topic than others that have been dealt with in polls on those sites.

But, the point is that, the correlation between these two different data points is surely interesting. Scoff if you like, but scoff meaningfully. How can the above two polls on different sites, with different people responding to it, be explained?

Monday Feb 10, 2014

Centralized Search Action

Here's how to show the Quick Search textfield in a dialog by clicking a menu item.
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Action;
import javax.swing.JPanel;
import org.openide.DialogDescriptor;
import org.openide.DialogDisplayer;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionRegistration;
import org.openide.awt.Actions;
import org.openide.util.NbBundle.Messages;
import org.openide.util.actions.Presenter;

@ActionID(
        category = "Edit",
        id = "org.bla.SearchAction"
)
@ActionRegistration(
        displayName = "#CTL_SearchAction"
)
@ActionReference(path = "Menu/File", position = 1300)
@Messages("CTL_SearchAction=Search")
public final class SearchAction implements ActionListener {
    @Override
    public void actionPerformed(ActionEvent e) {
        JPanel panel = new JPanel(new BorderLayout());
        Action qs = Actions.forID("Edit", "org.netbeans.modules.quicksearch.QuickSearchAction");
        Component quickSearchToolbarItem = ((Presenter.Toolbar) qs).getToolbarPresenter();
        panel.add(quickSearchToolbarItem, BorderLayout.CENTER);
        DialogDescriptor dd = new DialogDescriptor(panel, "Search");
        DialogDisplayer.getDefault().notify(dd);
    }
}

Thursday Feb 06, 2014

Functional Interfaces in the NetBeans Platform

SaveCookie, and the other loosely coupled capabilities in the NetBeans Platform, meet the requirements of the new concept functional interface in JDK 8. They're classes that have a single abstract method.

For example:

SaveCookie s = new SaveCookie() {
    public void save() {
        System.out.println("save to database...");
    }
};

When a change is made somewhere, you can publish the above into the Lookup, causing the SaveAction to be enabled, which means the Save menu item, toolbar button, and keyboard shortcut can be invoked. When invoked, the System.out above is executed.

The Java editor in the IDE lets you convert the above to the below, using the "Use lambda expression" hint:

SaveCookie s = () -> {
    System.out.println("save to database...");
}; 

Cleaned up even further, it can be simplified to this, though it's kind of unlikely you're going to have one statement in the method:

SaveCookie s = () -> System.out.println("save to database...");

On the other hand, you could point to a method, where the actual save functionality is found:

SaveCookie s = () -> save();

Wednesday Feb 05, 2014

LambdaFicator - From Imperative to Functional Code through Automated Refactoring

The origins of the awesome Java hints for migrating to JDK 8 in NetBeans 8 comes from the tooling that came out of the research shown below!

http://www.youtube.com/watch?v=EIyAflgHVpU

Tuesday Feb 04, 2014

YouTube: Starting a Project with the Vaadin NetBeans Plugin

Get started with Vaadin in NetBeans IDE, today!

http://www.youtube.com/watch?v=P9YupaOpsMk

Monday Feb 03, 2014

BufferedReader.lines

BufferedReader.lines is kind of interesting, letting you turn a BufferedReader into a java.util.Stream in Java 8. Here's some small experiments.

Print out the number of lines in a file:

public static void main(String[] args) {
    try (BufferedReader reader = Files.newBufferedReader(
            Paths.get("myfile.txt"),
            StandardCharsets.UTF_8)) {
        System.out.println(reader.lines().count());
    } catch (IOException ex) {
    }
}

Print out all the lines:

public static void main(String[] args) {
    try (BufferedReader reader = Files.newBufferedReader(
            Paths.get("myfile.txt"),
            StandardCharsets.UTF_8)) {
        reader.lines().forEach(System.out::println);
    } catch (IOException ex) {
    }
}

Print out the longest line in a file:

public static void main(String[] args) {
    try (BufferedReader reader = Files.newBufferedReader(
            Paths.get("myfile.txt"),
            StandardCharsets.UTF_8)) {
        System.out.println(reader
                .lines()
                .mapToInt(String::length)
                .max()
                .getAsInt());
    } catch (IOException ex) {
    }
}

Sunday Feb 02, 2014

RedMonk at FOSDEM: Lies, Damned Lies, and Statistics

Imagine you switch on the TV and you're just in time to catch the start of the weather report. The reporter is smiling cheerfully into the camera, while saying:

"We haven't been able to measure weather statistics in the whole country. In fact, we don't really know exactly how large the country is. Nevertheless, that being said, based on the weather statistics that we did manage to get hold of, here is the state of the weather today."

That, honestly, is what happened at FOSDEM yesterday in a packed out (people standing in the aisles, sitting on the floor, lined up outside in the corridor) RedMonk session entitled "What a Long Strange Trip It's Been: The Past, Present and Future of Java". (Here's the abstract.)

Now, Steve O'Grady was perfectly frank in saying exactly what he said (and says it again in his blog article), "to be included in this analysis, a language must be observable within both GitHub and Stack Overflow." And that's really all that's been analyzed, i.e., GitHub and Stack Overflow. (As a corollary, you then end up in the endlessly hilarious and inherently unresolvable discussion about what it means that there are many questions on Stack Overflow about a language -- (a) that it is popular, (b) that it is complicated, (c) that it is badly documented, (d) combinations of the above, (e) something else.) OK, so then I think the title "The RedMonk Programming Language Rankings: January 2014" is really too heavy for the analysis that's been done and the content it provides, especially since by their own admission they haven't surveyed closed-source corporate software development, nor have any clue about how to do so. I'd have thought they'd have built up a database of software companies around the world, that they've built relationships with these companies, and that thanks to the relationships they've developed they're able to regularly poll these companies on the software (and languages and frameworks and libraries and IDEs) they're using. However, this turns out to be quite clearly not the case at all.

And I don't think it's a credible defence to say, "hey, I told you that we didn't analyze anything other than GitHub and Stack Overflow" because a lot of organizations take the analysis of RedMonk (and similar organizations, such as Forrester, where the difference is you have to pay for the analysis results and you get an impressively authenticated PDF, rather than a free blog entry) very seriously, in the same way that the weather reporter saying "the weather today has been sunny with blue skies" is taken seriously, because no one reads the small print that says "hey, we really don't know how large the country is and we possibly haven't visited most of it". In the case of the weather report, that would be absurd and they wouldn't have a particularly strong basis to exist if they said that.

Personally, I have no reason to make this point other than a concern that we really do need usable and independent research to be done on the ubiquity of programming languages (and frameworks and libraries and IDEs), since the conclusions reached by RedMonk favor Java, which is my personal favorite language, the one I have been supporting and promoting for the past 10 years.

In other words, I have nothing to gain by calling RedMonk's bluff. (I'd argue that even if you call your own bluff, it's still bluff.) They reached a conclusion I would have wanted them to reach: Java is not only alive, it is vibrant, self-sustaining, used everywhere by everyone in all manner of application development. However, in a year or so, RedMonk may do another scan (or analysis or whatever) of GitHub and Stack Overflow and then come to completely different conclusions. And they would be as invalid and as silly to base any kind of conclusion on than the ones they have most recently come up with and were presented at FOSDEM yesterday:

OK, thanks, Java is very much alive and vibrant and is used for things other than enterprise applications. (Later that day I met up with John Kostaras from NATO, where they work on a massive Java desktop system that manages European air defence, which of course is yet another example of corporate work being done in Java that falls outside of RedMonk's research. In fact, if RedMonk were to research the ubiquity of Java desktop development, they'd say the Java desktop is dead, but only because NATO and all the other massive enterprises in the defence, aerospace, and banking domain don't use GitHub and Stack Overflow.) The call to action at the end was that we should spread the word that Java is alive. Great. Everyone except maybe analysts, who may have been scanning (or analyzing or whatever the verb is) some other repository somewhere and come up with contradictory conclusions, already knew that.

I'm sure I wasn't the only one left with the question marks outlined above, several of the discussions at the end of the session more or less asked the same thing, and the response was more or less the same, kind of along these lines: "Hey, we don't know how large the programming world is, we have no way of knowing that, we have to do the best we can with the data that we can get".

If that is really the case then, in the first place, I really appreciate the honesty. In the second place, however, I'd suggest that analysts start actually building relationships with companies and developers at companies, rather than with repositories and on-line discussion forums. In the third place, it's invalid to draw any broad conclusions from this analysis. The worst thing that one can do is to say, essentially, "yes, the weather statistics are incomplete and, what's worse, we have no clue how incomplete, nevertheless, that having been said, the skies are sunny and blue".

As a final point, the first photo above of the "packed out RedMonk session", (with people standing in the aisles, sitting on the floor, lined up outside in the corridor,) might indicate that there was a massive interest in the state of Java and especially in what RedMonk had to say about that, which might further underline (a) that Java is very popular and (b) that RedMonk is taken very seriously. Both those things may, of course, be true. But the photo doesn't prove that at all because... pretty much all the rooms at FOSDEM were "packed out". It's a free conference with a massive turnout and... surprisingly small rooms.

Saturday Feb 01, 2014

FOSDEM: Constantin Drabo from FasoJUG

The highlight of my trip to FOSDEM 2014 in Brussels was meeting Constantin Drabo for the first time, active in the NetCAT team for years, from Burkina Faso, where he set up the FasoJUG sometime ago.

Constantin is, aside from being a NetBeans fan, a Fedora fan. Above we're at the Fedora booth and between us is Jaroslav, the Fedora product manager.

It was great to meet you at last, Constantin!

Friday Jan 31, 2014

Awesome Blogs (Part 1): http://drunkendev.blogspot.nl

I'm starting a new occasional series where I highlight awesome blogs around the webiverse.

And a great one, what a pleasure to kick the series off with this one, is the brand new http://drunkendev.blogspot.nl by Brett Ryan, from Melbourne, Australia.

  • In Migrating to JDK 8 with NetBeans, his first blog entry, he shows how to set up and use NetBeans 8 to refactor applications to use JDK 8. It is well written, clear, has lots of screenshots, and is just a great read.

  • In The Power of the Arrow he shows 5 examples of code where he starts with a pre-Java 8 construct and then moves it step by step via NetBeans 8 to a new Java 8 lambdafied style, with all the intermediate steps included, and motivations why making the move makes sense.

And he says cool things about NetBeans 8, such as:

"I started doing these by hand and then slapped myself, NetBeans' hints can do all this for me. With NetBeans generally a hint will appear, you smile and accept it, possibly modify, then another hint might appear so you grin and accept that too; before you know it you've taken 5 or more lines down to 1."

I'm really looking forward to seeing what's next in Brett's blog!

Thursday Jan 30, 2014

YouTube: "Smart Migration to JDK 8"

Don't know where to start with JDK 8? Here's a complete kit of info getting you in the right frame of mind for upgrading your code to leverage the Java 8 language changes.

http://www.youtube.com/watch?v=http://www.youtube.com/watch?v=N8HsVgUDCn8

Feedback is welcome!

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
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today