Empty area above content, like an unused toolbar ?

Having problems with building or using the JCEF Java binding? Ask your questions here.

Empty area above content, like an unused toolbar ?

Postby Adriaanse » Wed Apr 13, 2022 3:19 pm

I have been trying to figure out where this comes from and I am not sure when this started, but if I build todays code there appears to be an empty area above the browser content that was not there about a year ago, it looks like an empty Toolbar, you can see it also in the "detailed" sample code on both Linux and Windows.

I am using BorderLayout, Center just the same as the sample code, I have checked that CefBrowser.GetUIComponent() has no titled border, padded layout or multiple child components that may cause this, Maybe someone else understands how to fix this, the empty space is valuable and should be filled with content ?

Thanks for any feedback I can get and sorry for posting yet another question here...
Adriaanse
Techie
 
Posts: 31
Joined: Fri Nov 16, 2018 9:21 am

Re: Empty area above content, like an unused toolbar ?

Postby Phylanx » Thu Apr 14, 2022 12:44 am

Hi!
Could you share a screenshot (maybe even from the detailed example)?
Which version of JCEF are you using and did you change any code on it?
Phylanx
Expert
 
Posts: 201
Joined: Thu Aug 11, 2016 8:17 am

Re: Empty area above content, like an unused toolbar ?

Postby Adriaanse » Thu Apr 14, 2022 3:46 am

I am using the latest binaries from the jcefmaven project, https://github.com/jcefmaven/jcefbuild/ ... tag/1.0.23, no modifications
The same happens if I compile it myself, same on linux, here is a screenshot, red line around the empty area

Image

Yesterday I was debugging our own application, I cold see the CefBrowserWr.setBounds() was called with y = 30 from a BorderLayout which has a 30 pixel JPanel inserted north of the cefBrowser, but i just could not figure out where this was created. I guess I should be debug the sample application instead, I will do so today and report back if I can find it.
Adriaanse
Techie
 
Posts: 31
Joined: Fri Nov 16, 2018 9:21 am

Re: Empty area above content, like an unused toolbar ?

Postby Adriaanse » Thu Apr 14, 2022 6:10 am

To answer my own question;

The detailed sample app does this:

private JPanel createContentPanel() {
JPanel contentPanel = new JPanel(new BorderLayout(0,0));
control_pane_ = new ControlPanel(getBrowser());
status_panel_ = new StatusPanel();
contentPanel.add(control_pane_, BorderLayout.NORTH);
contentPanel.add(status_panel_, BorderLayout.SOUTH);
return contentPanel;
}

So the padding comes from (unused) control_pane and status_panel and the problem is not in jcef.jar

The way Swing translates into Insets is confusing me when debugging, so I should look for an answer in my own code. case closed !
Adriaanse
Techie
 
Posts: 31
Joined: Fri Nov 16, 2018 9:21 am

Re: Empty area above content, like an unused toolbar ?

Postby Phylanx » Thu Apr 14, 2022 8:26 am

Great! :-)
Phylanx
Expert
 
Posts: 201
Joined: Thu Aug 11, 2016 8:17 am


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 18 guests