So , I have an operation where I hide and unhide the browser using Javascript on a button click event. I have some pictures positioned at specific coordinates put on top of my HTML page that I load. So whenever I hide the browser, it is throwing me this exception: java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
at java.awt.Component.getLocationOnScreen_NoTreeLock(Component.java:2048)
at java.awt.Component.getLocationOnScreen(Component.java:2022)
at org.cef.browser.CefBrowserOsr.getScreenPoint(CefBrowserOsr.java:248)
at org.cef.CefClient.getScreenPoint(CefClient.java:769)
How do I hide the browser correctly, so that I dont see this exception ?
I see the renderer handler is getting called every time and that is causing this exception.
Currently I just do browserPanel.setVisible(false) to hide the browser and browserPanel.setVisible(true) to show it , is this the right way ?