Examples of Advanced Techniques
Overview.
The simplest way to learn how to select and use the many methods available to you in the Task Editor for accomplishing various client tasks is often to study an existing program that does what you need to do. While the sports demo programs provided with Jargon Writer contain many of the most commonly used methods, other methods that provide more advanced techniques are not used in the sports demo.
To help developers quickly master these special methods, a number of simple example procedures are also included in the "xml\demo" subdirectory in all Jargon Writer releases. These examples illustrate how to do various specialized tasks. This document lists these xml applications with a brief description of each one.
To see how these methods are used, open each application in Jargon Writer, click the "exe" button to run it and see what it does, then open the Task Editor and look at the details of each tasklist to see how it does it.
Recall that you can go directly to a tasklist from the Design Window by selecting a component (such as a button) which has an event that is linked to a tasklist, and then double-clicking the tasklist in the "Tasklists to execute" listbox at the lower right.
Also, when in the Task Editor, remember that you can right-click the
tasklist name in the Task Tree to fully expand all its contents, rather
than expanding each task one at a time. A second right-click will fully
contract the tasklist. (Note: this can be done at any node level in a tree).
Changing Fonts (fonts.xml)
This client procedure shows how to change the font name, style and
point size used in a textfield, textarea or textpane component. Font changes
can be done in an init tasklist prior to first viewing a frame if you want
a particular font for the duration of a session, or fonts can be changed
dynamically at runtime if needed, as this example shows.
Integer math (math.xml)
This client procedure shows how to do simple integer math (add/subtract).
Multiplication and division methods are also available in the math package.
Note that you must include the math package from the "misc" toolbar in
a misc container, to use these methods.
String Manipulation (strings.xml)
This client procedure shows how to do string manipulations such as
"append" and "substring" to change a string value in a textfield or textarea.
Changing Table Sizes (tables.xml)
This client procedure shows how to dynamically change the number of
visible rows in a table and resize it correctly to only contain that exact
number of rows.
Using Fill and Weight Layout Parameters (weight.xml)
This client procedure shows how to use the gridbag "fill" and "weight"
parameters to control how components are resized when a frame is expanded
or dragged to a new size. Double-click the frame title to see the effects
when a frame is maximized, and again when it is normalized. These parameters
give you the ability to develop an application that "looks good" at multiple
screen resolutions and window sizes, although it can be somewhat time-consuming
to set up properly. But then, it is often the suble cosmetics that take
the most time and effort to get "just right", not the basic functionality
of the application.