Droplets SDK Examples
 

 

The Droplets SDK includes three sample Droplets that you can read, build and run to get a good idea of how Droplets works. In addition, three example Custom Components exist which show you how to extend the Droplets Platform with new components that you write yourself.

Example Droplets

The example Droplets can be found in your Droplets SDK installation at DropletSdk2.0/java/examples. The example Droplets are:

Droplet Description
Hello World Basic Droplets GUI with label and text
Subwindows A button that triggers an event (the opening of a sub-window).
Currency Converter Converts various world currencies into one another.

Each example Droplet contains its own sub-directory, which includes the following folders:

Folder Contains
build build.bat, which builds the Droplet
config Contains .reg file which registers the Droplet with the Server
Droplets File to run the Droplet as a standalone application (.drp)
src Java source code
www Contains files (if any) that the Droplet expects to find on the Web server.

To run any of these example Droplets simply perform these four steps:

  1. Go to that example's build directory and run build.bat.
  2. Go to the example's config directory and run ExampleName.reg.
  3. Start your Droplets Server (in the Droplets Server home directory).
  4. Go to that example's Droplets directory and run the .drp file.


Example Custom Components

You can also see three example Custom Components within your Java examples directory. Please note that improved version of the Slider and Tabs components have been included as a part of the Droplets Java API; the custom versions are included here as illustrations of how to write custom components:

Component Name Description Sample Code Documentation
Countdown Label that displays a number and begins visibly counting down upon a call from the Droplets UI Server. Click here Click here
Slider A component that allows users to graphically select a value by sliding a knob within a bounded interval. Click here Click here
Tabs A row of clickable notebook tabs. Click here Click here


Before writing your own custom components, consult the Droplets Java API documentation on the CustomComponent and ComponentAdapter for specific information on constructors and methods for these two classes.


Return to Droplets SDK Documentation Home