|
(no subject): msg#00179java.ulc.devel
Hello Janak I have found the cause of my error. I still had a method in my class (updateValue) which shouldn't have been there. I put it there when I was getting the errors due to the Dispatcher problem and forgot to remove it. Thanks for you help 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: ulc-developer-admin@xxxxxxxxxxxxxxx > >[mailto:ulc-developer-admin@xxxxxxxxxxxxxxx]On Behalf Of > >harrisonpf@xxxxxxxxxxxx > >Sent: Wednesday, July 19, 2006 4:52 PM > >To: ulc-developer@xxxxxxxxxxxxxxx > >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 ULC-developer@xxxxxxxxxxxxxxx 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
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | (no subject), harrisonpf |
|---|---|
| Next by Date: | AW: ulcscrollbar --> force to scroll to top --> found workaround, robert.munsky |
| Previous by Thread: | (no subject), harrisonpf |
| Next by Thread: | Extended TextArea - finally working!, Albert Smulders |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |