Purpose
Here is a Java bean that allows decorating the Forms application containers.
It becomes very easy to change all the fonts of a Forms application at runtime.
You can set the Font Family, weight and size, foreground and background color on the
following elements:
- . Menu bar
- . Menu options
- . Window title (font only)
- . Items
- . Status bar
The Java code
Personalize.java
The implementation class of the Bean Item
oracle.forms.fd.Personalize
The methods you can set
Set the element properties
Set_Custom_Property( 'BL.BEAN', 1, 'SET_PROPERTIES', 'properties' );
properties is : Element_type, Font name, Font weight, Font size[, Foreground color, Background color]
Element_type can be:
- . TextField
- . TextArea
- . Button
- . CheckBox
- . RadioB
- . Tree
- . ComboBox
- . PopList
- . TList
- . Tree
- . MenuBar
- . MenuOption
- . Status
- . Window
e.g. :
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'TextField,Tahoma,B,14,r0g128b255' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'Button,Tahoma,B,14,r0g128b255' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'CheckBox,Tahoma,B,14,r0g128b255' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'RadioB,Tahoma,B,14,r0g128b255' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'Tree,Tahoma,B,14,r0g128b255' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'ComboBox,Tahoma,B,14,r0g128b255' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'Tree,Tahoma,B,14,r0g128b255' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'MenuBar,Tahoma,B,14,r255g128b0,r200g255b150' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'MenuOption,Tahoma,B,14,r0g185b90,r255g255b150' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'Status,Tahoma,B,12,r255g255b255,r0g185b90' ) ;
Set_Custom_Property('BL.BEAN', 1, 'SET_PROPERTIES', 'Window,Tahoma,B,14' )
Start the decoration
Set_Custom_Property( 'BL.BEAN', 1, 'BEANINFO', '' );
The sample dialog
. Download the personalize.zip file
. Unzip the file
. copy the personalize.jar files in the <ORACLE_HOME>/forms/java directory
. Edit your /forms/server/formsweb.cfg file
. Open the personalize.fmb module (Oracle Forms 10.1 .2)
. Compile all and run the module