I use this code:
- Code: Select all
cefClient.addJSDialogHandler (new CefJSDialogHandlerAdapter ()
{
@Override
public boolean onJSDialog (CefBrowser browser, String origin_url, JSDialogType dialog_type, String message_text, String default_prompt_text, CefJSDialogCallback callback, BoolRef suppress_message)
{
if (dialog_type == JSDialogType.JSDIALOGTYPE_ALERT)
{
String btnOkText = "btnOkText";
JOptionPane.showOptionDialog (null, message_text, "title", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, new String[] {btnOkText}, btnOkText);
callback.Continue (true, "");
return true;
}
return false;
}
});
It show the message box but the app is not responding. I can't click message's button or even close this message...
Is it possible to add js custom dialogs using java (without recompiling jcef binaries)?