Wednesday December 03, 2008
Creating a NetBeans Platform Toolbar in 6.5
Creating a new toolbar for NetBeans IDE is now easy in 6.5. Just use the New Action wizard, which gives you an "ActionListener", and then replace the "ActionListener" implementation with a "Presenter.Toolbar", as shown here:
package org.demo.toolbar;
import java.awt.Component;
import org.openide.util.actions.Presenter;
public final class SomeAction implements Presenter.Toolbar {
//Here's where you put your panel into the toolbar area:
@Override
public Component getToolbarPresenter() {
return new DemoJPanel();
}
}
Finally, delete the "instanceCreate" attribute that the New Action wizard created in the layer.xml. Then install and you're done.
Update. See this tutorial for the complete example, the above is partial and incomplete.
Dec 03 2008, 06:42:06 AM PST Permalink


