Scrolling Ticker JavaBean Information

The Scrolling Ticker JavaBean displays a simply digital clock in the Forms Bean Area to which it is assigned.  The applet demonstrates how a JavaBean that is used by Forms can create it's own thread to use for processing independently of the main Forms runtime process.  In this case it allows the clock to continually update even whilst the Form is busy with some other task.  The bean also provides a demonstration of handling drag and drop with the mouse as you can move the clock text around within the bean area.

The JavaBean is integrated into the Form at runtime using the FBean package to register and manipulate the bean.

Modules In This Demo

The Scrolling Ticker demo consists of the following files (relative directories shown in brackets):

  1. ticker.fmb/fmx [forms]- The demo form
  2. TickerApplet.java [src/oracle/forms/demos/beans] - source code for the JavaBean class
  3. ticker.jar [classes]- the compiled and jarred java class.

The doc directory and the classes directory contain the JavaDoc for the code and the compiled class respectively.

Reusing the code

Setting up Forms Services

In order for an application to be able to use the Scrolling Ticker JavaBean, the relevant configuration in the formsweb.cfg file has to ensure that the supplied ticker.jar (or another jar file containing the compiled TickerApplet.class) is included in the relevant archive setting.

An entry in the formsweb.cfg file for an application that used the Scrolling Ticker JavaBean would look like this:

[Ticker]
pageTitle=OracleAS Forms Services - Scrolling Ticker Demo
IE=jinitiator
baseHTMLJInitiator=demobasejini.html
archive_jini=frmall_jinit.jar,ticker.jar
form=tickerforms/java
width=675
height=480
separateFrame=false
splashScreen=no
lookAndFeel=oracle
colorScheme=blue
background=/formsdemo/images/blue.gif

Using the JavaBean in your Form

Integration with the Scrolling Ticker JavaBean is achieved at runtime, with only the creation of an empty Bean Area and some coding required at build time.

The first step to create the bean at runtime is to use the FBean.Register() procedure to load the JavaBean into the assigned Bean Area.  This would normally be done at Forms start-up - for instance in the When-New-Form-Instance trigger. FBean.Register() takes three arguments:

In this case the class of the Scrolling Ticker bean is oracle.forms.demos.beans.TickerApplet. An example call to FBean.Register() would be something like:

FBean.Register_Bean('CTL.CLOCK',1,'oracle.forms.demos.beans.TickerApplet');

As soon as a bean is registered in this way, Forms will introspect it and internally create interfaces for calling methods and setting / getting properties on the bean using the FBean package.  In this case the start method can be called to start the clock using FBean.Invoke(). e.g.

FBean.Invoke('CTL.CLOCK',1,'start');

We can also set properties such as the Background color for the bean using FBean.Set_Property():

FBean.Set_Property('CTL.CLOCK',1,'background','255 255 255');

Property and Method Summary

The Scrolling Ticker JavaBean provides the following methods and properties:

Property Get Set Valid Values / Return Value Purpose
background Yes Yes RGB String Allows you to get or set the background color of the Ticker
foreground Yes Yes RGB String Allows you to get or set the foreground color of the Ticker
x Yes Yes Integer The X offset (in pixels) of the clock within the bean area
y Yes Yes Integer The Y offset (in pixels) of the clock within the bean area
fontSize Yes Yes Integer The size of the font used by the clock
Method Arguments Return Value Purpose
getTimeString   String  Returns time in format HH:MM:SS format
start     Starts the clock
stop     Stops the clock