package org.panda_lang.pandomium.wrapper;

import org.cef.browser.CefBrowser;

import javax.swing.*;
import java.awt.*;

public class PandomiumBrowser {

    private final CefBrowser cefBrowser;

    public PandomiumBrowser(CefBrowser cefBrowser) {
        this.cefBrowser = cefBrowser;
    }

    public JPanel toSwingComponent() {
        BorderLayout borderLayout = new BorderLayout();
        JPanel panel = new JPanel(borderLayout);

        panel.add(toAWTComponent(), BorderLayout.CENTER);
        return panel;
    }

    public Component toAWTComponent() {
        return cefBrowser.getUIComponent();
    }

    public CefBrowser getCefBrowser() {
        return cefBrowser;
    }

}

package org.panda_lang.pandomium.wrapper;

import org.cef.browser.CefBrowser;

import javax.swing.*;
import java.awt.*;

public class PandomiumBrowser {

    private final CefBrowser cefBrowser;

    public PandomiumBrowser(CefBrowser cefBrowser) {
        this.cefBrowser = cefBrowser;
    }

    public JPanel toSwingComponent() {
        JPanel panel = new JPanel();
        panel.add(toAWTComponent());
        return panel;
    }

    public Component toAWTComponent() {
        return cefBrowser.getUIComponent();
    }

    public CefBrowser getCefBrowser() {
        return cefBrowser;
    }

}

--- 
+++ 
@@ -14,8 +14,10 @@
     }
 
     public JPanel toSwingComponent() {
-        JPanel panel = new JPanel();
-        panel.add(toAWTComponent());
+        BorderLayout borderLayout = new BorderLayout();
+        JPanel panel = new JPanel(borderLayout);
+
+        panel.add(toAWTComponent(), BorderLayout.CENTER);
         return panel;
     }
 
Change a swing container layout to the border layout
