Calculator (English)

Here is a Java Bean that displays a calculator. Allows management mouse and keyboard 

It cannot run with the JInitiator and needs the Sun Java plug-in.

Scientific Calculator

Time Zones Java Bean   


Standard Calculator




The implementation class of the Bean Item

    oracle.forms.jvr.Calculator



The methods you can call

  • Set the frame title

    Set_Custom_Property('BL.BEAN',1, 'SET_TITULO','Calculator');

  • Set the label of the button that returns the value of the calculator

    Set_Custom_Property('BL.BEAN',1, 'SET_BOTON','Get Value');

  • Set the frame position (x,y)

    Set_Custom_Property('BL.BEAN',1, 'SET_POSICION','300,150');

  • Set the initial value

    Set_Custom_Property('BL.BEAN',1, 'SET_VALORINICIAL','');

  • Set the Calculator Mode   (E- Standard / C-Scientific)
    Set_Custom_Property ( 'BL.BEAN', 1, 'SET_MODO','C');
  • Show the calculator

    Set_Custom_Property('BL.BEAN',1, 'SHOW','');




The event sent by the Java Bean

CALCULATOR_EVENT

This event tells Forms that a date has been chosen in the calculator.
You can get it in a WHEN-CUSTOM-ITEM-EVENT event:


DECLARE
    eventName varchar2(30) := :system.custom_item_event;
    eventValues ParamList;
    eventValueType number;
    valor varchar2(256); -- Calculator Value

BEGIN
    IF eventName='CALCULATOR_EVENT' THEN
        eventValues:=get_parameter_list(:system.custom_item_event_parameters);
        get_parameter_attr(eventValues,'CALCULATOR_VALOR',eventValueType, valor);
        Clear_Message;
        Message('Calculator Value: '|| valor );
        Synchronize ; 
    END IF; 
END;


The sample dialog

    . Unzip the Calculator.zip file
    . Copy the Calculator.jar file in your /forms/java/ folder
    . Add it to the archive tag of the /forms/server/formsweb.cfg file
    . Open the Calculator.fmb module (Oracle Forms 10.1.2)
    . Compile all and run the module


The JAR file must be signed

The JAR file provided with the ZIP file is already signed