Overblog Suivre ce blog
Editer l'article Administration Créer mon blog
31 août 2009 1 31 /08 /août /2009 16:20

Here is a Java Bean from Jesus Vallejo that
displays a calculator.
It cannot run with the JInitiator and needs the Sun Java plug-in.

Time Zones Java Bean

The implementation class of the Bean Item





The Java code



     Calculator.java     CalculatorOperations.java




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','');


  • Show the calculator

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



The event sent by the Java Bean

This event tells Forms that a date has been chosen in the calculator.

You can get it in a WHEN-CUSTOM-ITEM-EVENT event:

    eventName varchar2(30) := :system.custom_item_event;
    eventValues ParamList;
    eventValueType number;
    valor     varchar2(256); -- Calculator Value
      eventValues := get_parameter_list(:system.custom_item_event_parameters);
      get_parameter_attr(eventValues,'CALCULATOR_VALOR',eventValueType, valor);
      Message('Calculator Value: '|| valor );
      Synchronize ;           
   END IF;  


The sample dialog

Download the Calculator.zip file
     . 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

For any question concerning this bean, send a mail to Jesus at vallejo.jesus@gmail.com.

Partager cet article

Repost 0
Published by Oracle Forms community - dans Bean - general
commenter cet article