TOC PREV NEXT INDEX



Add actions


Next you will use the Code Sourcerer to add functionality to some of the commands.

  1. Select the Code Before node which is under the Clear command in the tree.
  2. Press the Code Sourcerer button.
  3. Choose the first item, 'Change a property of an existing part'. Press Next.
  4. Choose 'query', the TextBox in your application. Press Next.
  5. Choose 'Change text of Text Box...'. Press Next.
  6. The Code Sourcerer now asks you where to get the new text for the Text Box. We want to simply erase the current text, so choose the first option, and leave the text field to the right blank. Press Done.
    The following code should have appeared.
try {
query.setString("");
}
catch ( IllegalArgumentException excpt0 ) {
}

Next you will create the code to exit the client.

  1. Choose the Code Before node under the Exit command in the tree.
  2. Press the Code Sourcerer button in the property sheet to the right.
  3. Choose the 'MIDlet control operations...' item. Press Next.
  4. Choose the last option, 'Exit this MIDlet'. Press Done.
    The following text will appear in the code area.
try {destroyApp(true);} catch (Exception e) {}
notifyDestroyed();

Data Representations, Inc.
http://www.datarepresentations.com
support@datarepresentations.com
sales@datarepresentations.com
TOC PREV NEXT INDEX