Overblog Suivre ce blog
Administration Créer mon blog
3 février 2006 5 03 /02 /février /2006 15:24


When you want to load images from the client machine to the database, you would like
to choose the right image file with a preview of each image.

This is a Javabean component that allows to display a JfileChooser dialog box with image preview.
It also allows to display at the same time different file types.


The java code

Get the complete code here

Forms configuration

  • Copy the GetImageFileName.jar file in the /forms/java directory
  • Sign the GetImageFileName.jar file with your own certificate
  • Edit the /forms/server/formsweb.cfg file to add the jar file to the archive_jinit variable

Registring the bean

- Open the form
- Add a javabean component to any block
- Register the bean (be sure that it is not in a When-New-Form-Instance trigger, or use a timer)





Invoke the bean's GetFile() function

image_file_name := FBean.Invoke_char('BLOCK.BEAN_ITEM',1,'GetFile','"Dialog box title","start directory"');




 :BL1.File := FBean.Invoke_char('BL1.IMAGEPICKER',1,'GetFile','"Select an image file name","M:\"');

The sample dialog

  • Download the imagefilechooser.zip file
  • Unzip the imagefilechooser.zip file
  • Copy the imagefilechooser.jar file in your /forms/java/ directory
  • Edit your /forms/server/formsweb.cfg file
  • Open the IMAGEFILECHOOSER.fmb module (Oracle Forms 9.0.2)
  • Compile all and run the module

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