Hi Janak Thanks for the help. I managed to build the event handler using the example in section 4.3 of the Extensions guide. I did have problems that it was searching for methods from the super class (in my case the ULCTextField) that didn't exist in my class. I then changed my dispatcher to to be a subclass of ULCTextFieldDispatcher instead of the ULCProxyDispatcher and everything was working fine.
I am now having some strange experiences with the value change listener on the text field! It fires a valueChanged event when the value changes but when I get the value frmo the event source it returns me null for the first time the event fires (although I enter a value) and then each time the event fires, it sends me the first value entered. The value never changes! Yes I am still working for Ottomobil and also building the framework privately for my own company Paul Janak Mulani wrote: > Hi Paul, > > ULC Extension Guide for ULC 6.1 has an example of creating ActionEvent on > the Pie Chart widget. > > Nevertheless, I have created a small snippet for you which can be found at > the end of this mail. > > Thanks and regards, > > Janak > > PS: Are you still developing for Ottomobil? > >> -----Original Message----- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] Behalf Of >> [EMAIL PROTECTED] >> Sent: Wednesday, July 19, 2006 4:52 PM >> To: [email protected] >> Subject: [ULC-developer] Double Click in an ULCTextField >> >> >> I need to perform an action when the users double click within an >> ULCTextField. I have searched the archive but have onlyfound >> double clicking in an ULCTable (action Listener). How do I know >> that a user has double clicked on an ULCTextItem? >> >> Thanks > -------------------------- > > import com.ulcjava.base.application.AbstractApplication; > import com.ulcjava.base.application.ULCBoxPane; > import com.ulcjava.base.application.ULCFrame; > import com.ulcjava.base.application.ULCTextField; > import com.ulcjava.base.application.event.ActionEvent; > import com.ulcjava.base.application.event.IActionListener; > import com.ulcjava.base.client.UITextField; > import com.ulcjava.base.development.DevelopmentRunner; > > import javax.swing.SwingUtilities; > > import java.awt.event.MouseEvent; > import java.awt.event.MouseListener; > > public class ActioneventOnTextFieldSnippet extends AbstractApplication { > > public void start() { > > final ULCActionTextField textField = new ULCActionTextField(20); > > textField.addActionListener(new IActionListener() { > > public void actionPerformed(ActionEvent event) { > textField.setText("Action Performed"); > } > > }); > > ULCBoxPane box = new ULCBoxPane(); > box.add(ULCBoxPane.BOX_CENTER_CENTER, textField); > > ULCFrame frame = new ULCFrame("ActioneventOnTextFieldSnippet"); > frame.setDefaultCloseOperation(ULCFrame.TERMINATE_ON_CLOSE); > frame.add(box); > frame.setSize(200, 200); > frame.setVisible(true); > } > > public static void main(String[] args) { > DevelopmentRunner.setApplicationClass(ActioneventOnTextFieldSnippet. > class); > DevelopmentRunner.main(args); > } > > public static class ULCActionTextField extends ULCTextField { > public ULCActionTextField(int i) { > super(i); > } > > protected String typeString() { > return UIActiontextField.class.getName(); > } > } > > public static class UIActiontextField extends UITextField { > > protected void postInitializeState() { > super.postInitializeState(); > getBasicTextField().addMouseListener(new MouseListener() { > > public void mouseClicked(MouseEvent e) { > } > > public void mouseEntered(MouseEvent e) { > } > > public void mouseExited(MouseEvent e) { > } > > public void mousePressed(MouseEvent e) { > if (isEnabled() && e.getClickCount() == 2 && > SwingUtilities.isLeftMouseButton(e)) { > fireActionPerformedULC(null, e.getModifiers()); > } > } > > public void mouseReleased(MouseEvent e) { > } > }); > } > } > } > > _______________________________________________ > ULC-developer mailing list > [email protected] > http://lists.canoo.com/mailman/listinfo/ulc-developer > _____________________________________________________________ NEU: Ihre Photos online verwalten, mit anderen teilen und die besten Bilder gleich entwickeln lassen - GRATIS für den 1. Monat (exkl. Entwicklung) www.sunrise.ch/photoalbum _______________________________________________ ULC-developer mailing list [email protected] http://lists.canoo.com/mailman/listinfo/ulc-developer
