JBCefBrowser, how to properly set HTML string Follow
In my plugin I have HTML I need to display to my user, which I have as just a String of HTML. I'm trying to use the JBCefBrowser with the following code:
JBCefBrowser myBrowser = new JBCefBrowser();
The window will open, but its contents are always blank:
What am I doing wrong?
Please sign in to leave a comment.
Please show more context of your code and specify what IDE version/JBR you're using. Ideally link to your plugin sources to reproduce.
Hi Yann! You beat me to it, was about to reply! My problem was just not fully understanding how to use this component. I have it working now with this code:
Where "html" is a string of HTML getting passed to my method, and "htmlPanel" is a JPanel.
Ran into a similar issue, and found that using BorderLayout made it work for me.
Sorry to bother you, but I came across the same problem. I tried to new a JPanel like this:
But there was nothing to display. And there was no error created.
Bing you don't specify BorderLayout in JPanel constructor call
It still does not work to add BoderLayout