|
|
|
|
Working with Resources : Customization of Initial Font, Color and Background
|
|
Step by Step
Import the usual figue packages.
|
import figue.*;
import figue.box.*;
import figue.path.*; |
Import the resource package.
Define an initializer.
|
private final FacadeInitializer getParameters() {
FacadeInitializer theParameters = new FacadeInitializer(); |
Add to the initializer the name of initial resources.
|
theParameters.setInitialColor("My color");
theParameters.setInitialBackground("My background");
theParameters.setInitialFont("My font");
return theParameters; |
Pass the initializer to the facade on creation.
|
_facade = new AWTFacade(getParameters()); |
Create the relevant named resources.
|
private final void initResources() {
try {
_facade.doGetFont("My font",FontFamily.TIMES_ROMAN,
FontStyle.BOLD_ITALIC,24,false);
_facade.doGetColor("My background",BasicColor.RED);
_facade.doGetColor("My color",BasicColor.YELLOW); |
|
|
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.
|
|
|
Related Classes
and Methods
|
|
|
What Next ?
Now you can :
|
|
|
|
|
|
|
|
|