java - WebView not working again after close -


I am trying to instantiate many GeFrames with WebVisse, it will work until the first web After this, at least one webview is still alive and JFRM (with everything else) is not settled.

After some investigation, it seems that after shutting down all WebVia JFrame, Platform.runLater () now next JFrame with immediate WebFiewPanel.

The following is the simplified code:

  public class WebViewPanel {Private JFXPanel jfxPanel; Private webview view; Private web engine webengine; Private Jepynel Panel; Public WebViewPanel (JPanel Panel) {this.panel = Panel; Panel.setVisible (true); CreateScene (); } Private void createScene () {Platform.runLater (New Runnabal) {@Override Public Zero Run (Run) {// Runnable now goes after JFrames jfxPanel = new JFXPanel () with all WebFiewPanels; View = new WebView (); WebEngine = Vih. Gatienjin (); JeffPennell.Setsen (new view (see)); Panel.ed (jfxpanel); JFXPanel.Set (right);}}); }}  

So, what should I do to solve this problem?

This happens because the platform exits itself, if not explicitly set.

Add

  Platform.runLater (new Runnabel () {//   

here Platform.setImplicitExit (false) ; first line

then your new code will be -

  Private Zero Season () {Platform.runLater (New Runnab) (Platform.setImplicitExit ); @ Override Public Zero Run (jfxPanel = new JFXPanel;); View = New WebView;); WebEngine = view.getEngine (); jfxPanel.setScene (new view (see)); panel.edfxPanel; JfxPanel.setVisible (true);}})}}  

FYI only if you are trying to display the panel more than once There is no need to make. Sken () Add JFXPanel to JFrame (preferi bleed panel also works fine with a constant reference) Set the frame to close it and then when you need to show it So set the same frame set whiSalele (true); Each time you call this frame you can also see that the static reference of this frame indicates zero (to represent the first call) If so, call CREATESCACEIN () and just set the constant reference for the visible.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -