From awoss@ncsa.uiuc.edu  Wed Mar 18 11:10:03 1998
Date: Wed, 18 Mar 1998 11:08:14 -0600 (CST)
From: Al Woss 
To: chai@uiuc.edu
Subject: textfield
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Content-Length: 942

Ian,

Here's the collab textField.
Notice how the contructor enables action events, allowing it to intercept 
them and send them using Habanero.sendEvent().

AL



import java.awt.*;
import java.awt.event.*;
import ncsa.habanero.*;
class CollabTextField extends TextField
{
	CollabTextField()
	{
		this("");
	}
	
	CollabTextField(String str)
	{
		this(str, 4);
	}
	
	CollabTextField(int col)
	{
		this("", col);
	}

	CollabTextField(String str, int col)
	{
		super(str, col);
		enableEvents(AWTEvent.ACTION_EVENT_MASK);
	}
	protected void processActionEvent(ActionEvent e)
	{
		if (e.getSource() != null)
		{
			Habanero.sendEvent(e);
		}
		else
		{
			setText(e.getActionCommand());
			ActionEvent newAE = new ActionEvent(this, e.getID(), getText());			
super.processActionEvent(newAE);
		}
	}
}

Algis Woss					B
					       ///
NCSA Habanero Research Programmer   	   T  ///   D
awoss@ncsa.uiuc.edu			      ///	
					      //
					     /