void () { if (myDevtoolsFrame != null) { myDevtoolsFrame.setVisible(true); myDevtoolsFrame.toFront(); return; } Component comp = getComponent(); Window ancestor = comp == null ? KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow() : SwingUtilities.getWindowAncestor(comp); if (ancestor == null) return; Rectangle bounds = ancestor.getGraphicsConfiguration().getBounds(); myDevtoolsFrame = new JDialog(ancestor); myDevtoolsFrame.setTitle("JCEF DevTools"); myDevtoolsFrame.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); myDevtoolsFrame.setBounds(bounds.width / 4 + 100, bounds.height / 4 + 100, bounds.width / 2, bounds.height / 2); myDevtoolsFrame.setLayout(new BorderLayout()); JBCefBrowser devTools = JBCefBrowser.createBuilder().setCefBrowser(myCefBrowser.getDevTools()).setClient(myCefClient).build(); myDevtoolsFrame.add(devTools.getComponent(), BorderLayout.CENTER); Disposer.register(this, devTools); Disposer.register(this, new Disposable() { @Override public void dispose() { myDevtoolsFrame.dispose(); } }); myDevtoolsFrame.setVisible(true); }