Problem in default loading URL in the browserUI

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

Problem in default loading URL in the browserUI

Postby hibra » Mon Oct 01, 2018 7:24 am

Hi,

I am trying to add a browser with its UI component to a panel, that when loaded it has a textfield, a button, and the bowserUI which has a predefined prefferedSize. Here is the actionPerformed associated to the button:

goButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
browser_.loadURL(getAddress());
}
});

the statement: browser_.loadURL(getAddress()); is also called in the constructor of the panel in order to load a default URL which is already initialized as a value for the textfield.
The problem is that the URL is not loaded by default, however, it is loaded when I click the button. Any ideas for a solution or a source of this problem?


Best
hibra
Techie
 
Posts: 13
Joined: Thu Aug 09, 2018 8:15 am

Re: Problem in default loading URL in the browserUI

Postby magreenblatt » Mon Oct 01, 2018 7:44 am

You need to pass the URL to CefClient.createBrowser if you want it to be the startup URL for the browser.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Problem in default loading URL in the browserUI

Postby hibra » Mon Oct 01, 2018 8:25 am

Thank you! This solved the problem :)
hibra
Techie
 
Posts: 13
Joined: Thu Aug 09, 2018 8:15 am


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 32 guests