void (CefApp.CefAppState state) { if (state == CefApp.CefAppState.INITIALIZED) { SwingUtilities.invokeLater(() -> { final CookieManagerDialog myCookieManagerDialog = new CookieManagerDialog(frame, myJBCefBrowser); myCookieManagerDialog.setVisible(false); final JButton myShowCookieManagerButton = new JButton(myCookieManagerText); myShowCookieManagerButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { myCookieManagerDialog.setVisible(true); List<JBCefCookie> cookies = myJBCefBrowser.getJBCefCookieManager().getCookies(); myCookieManagerDialog.update(cookies); } }); controlPanel.add(myShowCookieManagerButton); }); } }