Menu

anonymous functions, netbeans support

Yet another quick update... I have added support for anonymous functions, for those times when you don't want to bother with a named function or type. For example, you could implement an ActionListener for GUI code as follows:

var textField = new javax.swing.JButton("0",5);
frame.add(textField);
var button = new javax.swing.JButton("Foo!");
button.addActionListener( new (function() extends java.awt.event.ActionListener() {
public function actionPerformed( evt )
{
textField.setText( 1 + textField.getText() );
}
})() );
frame.add(button);

In other news, I cobbled together some netbeans support, using the scripting module. So you can execute script you are working on directly from the netbeans IDE. I haven't added support for colorizing, or auto-indenting, but if anyone out there wants to help with this, let me know. rob@ti.com, is the best way to get in touch with me. If the src isn't already posted at sourceforge, I can email you the latest. (Hopefully I should have the go-ahead to upload to CVS any day now.)

Posted by Rob Clark 2001-04-17

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.