Over a million developers have joined DZone.

Lingen on the NetBeans Platform

DZone 's Guide to

Lingen on the NetBeans Platform

· Java Zone ·
Free Resource

A group of students at the Fachhochschule (technical college) Osnabrück in Lingen, Germany, are currently taking a NetBeans Platform course. We're using NetBeans IDE 7.0 Beta 2 and so far, as far as I am aware, there have been no problems (just much much faster than before, plus nice TopComponent annotations, hurray) that have arisen as a result of using this beta release.

The day started with an overview of what NetBeans is, where it comes from, and what the main features of the NetBeans Platform are. Then we deep dived into the module system. Dream team member Aljoscha Rittner is delivering the course together with me, he's currently introducing the class to the window system.

Here's a snapshot:

We've created a few small applications so far, such as this pluggable text editor. Each of the tools shown in the combobox below comes from a different plugin, while the window shown below doesn't know anything about them. Instead, the Lookup.getDefault construction is used to load implementations from the META-INF/services folder:

The interesting code, in the constructor of the window:

final DefaultComboBoxModel dcbm = new DefaultComboBoxModel();

Collection<? extends WordFilterInterface> allFilters = Lookup.getDefault().lookupAll(WordFilterInterface.class);

for (WordFilterInterface filter : allFilters) {

jButton1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

String myPlainText = jTextField1.getText();

WordFilterInterface wfi = (WordFilterInterface) dcbm.getSelectedItem();

String myProcessedText = wfi.process(myPlainText);





The question you might have is how, if the filter is added to the combo box, is a string displayed in it? Well, the combo box has a default renderer that uses the toString() method of the object it displays to create the label displayed within it:

public class LowercaseFilter implements WordFilterInterface {

public String name() {
return "Lowercase";

public String definition() {
return "Turns the word to lowercase";

public String process(String word) {
return word.toLowerCase();

public String toString() {
return name();


Interested in a NetBeans Platform training too? Go here for all the details.



Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}