Purpose

This enhanced Java Bean is a "fast" open/save file chooser dialog, based on the AWT system, for those who think that the Swing JFileChooser available is too "slow".

It uses the FBean package.





The Java code

     AWTFileDialog.java



The methods you can set


Register the bean


The Implementation Class is : oracle.forms.fd.AWTFileDialog

FBean.Register_Bean('CTRL.BEAN', 1, 'oracle.forms.fd.AWTFileDialog');

 



Open file dialog box


var := FBean.Invoke_Char('CTRL.BEAN', 1, 'openFile' ,'Open a file...,C:\,*.java');

The last argument is composed by a title, a starting directory and a file filter.
If you want to provide a file type list, separate them with a ; like the following:
var := FBean.Invoke_Char('CTRL.BEAN', 1, 'openFile' ,'Open a file...,C:\,*.jpg;*.jpeg;*.gif');

 


Save file dialog box


var := FBean.Invoke_Char('CTRL.BEAN', 1, 'saveFile' ,'Save file as......,C:\,filename.txt');



set debug ON/OFF


FBean.Invoke('CTRL.BEAN', 1, 'setLog' ,'true | false');






The sample dialog


     . Download the AWTFileDialog.jar file
     . Download the AWTFileDialog.fmb file
     . copy the AWTFileDialog.jar file in the <ORACLE_HOME>/forms/java directory
     . Edit your /forms/server/formsweb.cfg file to add the AWTFileDialog.jar to both archive and archive_jini tags.
     . Open the AWTFileDialog.fmb module
     . Compile all and run the module

See also another File selection bean by Hafed Benteftifa