Note: The XAMJ language effort is
no longer active,
and this page remains here for historical purposes only.
You can find the latest source code of this sub-effort in CVS
module XAMJ_Project/XAMJ_Extension. You might want to check out
what we're doing with JavaFX.
Examples
The following are very simple examples
that will give you an
idea of what XAMJ code looks like. For a broader
range of capabilities, see our documentation.
NOTE: To run these examples you need to
install the Warrior Platform 0.94.1+ first.
- Hello World # 1
[Run It]
[Source]
This is a barebones Hello World document. It should appear
in the Warrior frame.
- Hello World # 2
[Run It]
[Source]
This is a standalone hello world app with a title and
window bounds 150x200. The document-disposition element
tells it to use a standalone window to render the document
instead of a Warrior browser frame.
Note also that text is bigger due to the span element
which sets markup style.
- Simple Calculator
[Run It]
[Source]
This is a very simple calculator written in XAMJ. It uses
some Java code. The
example illustrates how to loop to generate many similar widgets, in
this case buttons, and how events are handled.
- Paint (Java2D) Demo
[Run It]
[Source]
This example shows how to use the on-paint event on a box. It
uses Java2D to fill a round rectangle using a gradient paint.
- Mini-Warrior
[Run It]
[Source]
This is a stripped-down version of the Warrior browser
in about 150 lines of XAMJ code.
This example illustrates how to manage browser frames,
process events, and update widget properties, specifically
the properties of a progress bar.
If you have written XAMJ code of your own, or if you're
having trouble writing XAMJ code, please let us know.
|