Search












 

Handling user events in Droplets is just like handling them in Java. The first step is importing the Droplets Event package - called com.droplets.api.event.* - into your application logic.

There are four things that your application will need in order to handle button clicks and similar user-initiated events.

1. An implementation of the ClickListener interface.

This is the object that will listen for button clicks and respond appropriately.

class clicker implements ClickListener{
...
}

2. A handleClick() method within the ClickListener.

This method will define the action that is taken whenever a particular button is clicked.

public void handleClick(ClickEvent e) {
...
}

3. A ClickEvent.

This is automatically created by the Droplets Platform whenever a button is clicked, so we simply have to include it as an argument to the handleClick() method.

handleClick(ClickEvent e)

4. A handleClick() method within the ClickListener.

Within the class in which you add your components to the GUI window, create an instance of your ClickListener, and then make a call to the button's addClickListener() method with this ClickListener as the parameter.

clicker click = new clicker(getApplication());
button.addClickListener(click);

<<< previous home next >>>


Questions?
Contact us
Call 214.969.9970
Fax 214.774.4900

 


Article
java.sun.com: Droplets brings GUIs to the Internet

 
 


News
U.S. Patent Office Issues Patent for Droplets' Groundbreaking Technology 

Droplets, Inc., Awarded Government GSA Contract 

Java Servlets Get a New Lease on Life with Droplets 

Droplets Announces Linux Validation For All IBM eServer Platforms

Borland® JBuilder™ To Include Droplets User Interface Server™ and SDK

Droplets Earns Prestigious SunTone Certification from Sun Microsystems

 
   
©2004-2024 Droplets, Inc. All rights reserved. Protected by U.S. Patents 6,687,745 - 8,626,829 - 9,397,971 - 9,807,200 Australia Patent 769099, Canada Patents 2385044, 2744848, Japan Patents 5,468,186 - 5,108,967 - 5,143,926. This website does not collect any data from visitors for any purpose.