Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using Java Swing JFrame in Oracle forms 11g

Shahzad Ahmed KhanSep 25 2014 — edited Sep 29 2014

Hello All,

I am using Oracle forms 11.1.2.2.0.

I have a java class which display a url in java swing jframe. I want to display this java window inside oracle forms. I dont know how to display this jframe inside oracle forms. I have created a bean area on form and set the implementation class to this java class. I have also added the jar file of this java class in formsweb.cfg (archive=frmall.jar,MyJxBrowser.jar). When i run the form it throws a FRM-92091 execption.

pastedImage_0.png

Here is my java class code.

package helloworldsample;

import com.teamdev.jxbrowser.chromium.Browser;

import com.teamdev.jxbrowser.chromium.BrowserFactory;

import javax.swing.*;

import java.awt.*;

import java.util.concurrent.TimeUnit;

import oracle.forms.ui.VBean;

public class HelloWorldSample extends VBean{

@SuppressWarnings("compatibility:5834594399777333529")

private static final long serialVersionUID = 1L;

public HelloWorldSample(){

    super();

}

public static void showBrowser(String url){

    Browser browser = BrowserFactory.create();

    JFrame frame = new JFrame("My Browser");

    frame.setDefaultCloseOperation(WindowConstants.EXIT\_ON\_CLOSE);

    frame.add(browser.getView().getComponent(), BorderLayout.CENTER);

    frame.setSize(300, 300);

    frame.setExtendedState(frame.MAXIMIZED\_BOTH);

    frame.setVisible(true);

    //browser.loadHTML("\<html>\<body>\<h1>Hello world!\</h1>\</body>\</html>");

    browser.loadURL(url);

    while (browser.isLoading()) {

        try {

            TimeUnit.MILLISECONDS.wait(50);

        } catch (InterruptedException e) {

            JOptionPane.showMessageDialog(null, "Exception while opening url : "+e.getMessage());

        }

    } 

}

}

I am not sure i am doing right or not. Do i have to do some more configuration. Can we able to display java Jframe inside oracle forms 11g?

Please help and thanks in advance

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 27 2014
Added on Sep 25 2014
3 comments
2,385 views