Search code examples
javaswingjxbrowser

JX-Browserview overlap existing content of the system


I'm currently facing some UI issues while integrating JX-Browser in existing software.

  1. Problem 1: Background menu items are hidden by JX-Browser view

Background menu items are hidden with JX-Browser view

  1. Problem 2: Holding J-Frame and Panel can be separated in restored mode

enter image description here

I'm using JX_Browser 6.6 version. But the important thing is all above problems are disappeared if I used 5.1 version

code samples:

public class JXBrowserAdapter extends JPanel
{   

   private Browser browser;

   public JXBrowserAdapter()
   {
     this.setLayout(new BorderLayout());
     initializeBrowserLogin();
     initializeBrowser();
   }

private void initializeBrowser()
{ 
  BrowserPreferences.setChromiumSwitches( GrowthChartConstants.DISABLE_WEB_SECURITY,
    GrowthChartConstants.ALLOW_FILE_ACCESS_PROPERTY);

  browser = new Browser();
  final BrowserView browserView = new BrowserView(browser);
  browser.setDialogHandler(new DefaultDialogHandler(browserView));
  browser.setPopupHandler(new DefaultPopupHandler());

  this.add(browserView, BorderLayout.CENTER);
}

Java version: 1.6/ Windows 7

Please help me to figure out this issue.


Solution

  • In JxBrowser 6.0 and higher, the heavyweight rendering mode is enabled by default. According to what I see, in your application it's preferable to use lightweight rendering mode.

    FYI, lightweight rendering mode is enabled by default in JxBrowser 5. This is why you don't see this issue with JxBrowser 5.

    To enable lightweight rendering mode in JxBrowser 6 please use the following code:

    Browser browser = new Browser(BrowserType.LIGHTWEIGHT);