void (ActionEvent e) { MyOkCancelDialog<JPanel> dialog = new MyOkCancelDialog<>(frame, "Load HTML with URL"); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); JTextField url = new JTextField("file://foo/bar"); //noinspection NonAsciiCharacters JTextArea html = new JTextArea("<html>\n<body>\nСъешь Еще Этих Мягких Французских Булок &#129366;&#129366;\n</body>\n</html>"); panel.add(url, BorderLayout.NORTH); panel.add(html, BorderLayout.CENTER); dialog.setComponent(panel); dialog.setOkAction(() -> { myUrlBar.setText(url.getText()); SwingUtilities.invokeLater(() -> myJBCefBrowser.loadHTML(html.getText(), url.getText())); }, "Load"); dialog.show(); }