|
|
|
|
Getting Started : The Hello World Application
|
|
Step by Step
Import the main figue package.
Import the box package.
Import the path package.
Create the usual java application.
|
public class MyApplication extends java.awt.Frame { |
Keep a reference to an AWT facade.
|
private AWTFacade _facade; |
Initialize the AWT facade.
|
_facade = new AWTFacade(); |
Add the facade's AWT component to the layout.
|
add(BorderLayout.CENTER,_facade.getAwtComponent()) |
Build an atom.
|
GlyphInterface theMessage = Atom.newAtom("Hello World"); |
Create a modification path.
|
PathInterface thePath = new Path(); |
Add the atom to the path.
|
thePath.addOperation(new InsertGlyph(theMessage,0)); |
Apply the path to the facade.
|
_facade.buildInit(thePath);
_facade.buildComplete(); |
Free all resources when done.
|
Button theButton = new Button("Close");
...
theButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent anEvent) {
_facade.disposeWhenInactive();
_facade = null; |
|
|
Example
- Accelerators :
- home, end, page up, page down, left arrow,right arrow, up arrow, down arrow.
- Autoscrolling :
- drag the mouse inside the
text area, approach a border or a corner, and wait.
- Actions :
-
- - close the window with the close button.
-
|
|
|
Related Classes
and Methods
|
|
|
What Next ?
Now you can :
- continue on this lesson to learn about
lines
- learn more about :
- [PENDING : links to related issue]
- go back to the table of contents
|
|
|
|
|
|
|
|
|