Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8088966

[SWT, Linux, GTK3] FxCanvas can't handle gtk3 libs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 9
    • 7u6
    • javafx
    • None
    • Ubuntu 12.04 x64

      Eclipse Luna force loads gtk3 libs on Linux / Unix - https://bugs.eclipse.org/bugs/show_bug.cgi?id=420182
      Every time after running the above sample against gtk3 libs, the native error will appear.

      import org.eclipse.swt.SWT;
      import org.eclipse.swt.layout.FillLayout;
      import org.eclipse.swt.widgets.Composite;
      import org.eclipse.swt.widgets.Display;
      import org.eclipse.swt.widgets.Shell;

      import javafx.embed.swt.FXCanvas;
      import javafx.scene.Scene;
      import javafx.scene.web.WebEngine;
      import javafx.scene.web.WebView;

      public class JavaFxBrowser extends FXCanvas {

      public JavaFxBrowser(Composite parent) {
      super(parent, SWT.NONE);
      WebView browser = new WebView();
      this.setScene(new Scene(browser));
      WebEngine webEngine = browser.getEngine();
      webEngine.load("http://www.oracle.com");
      }

      public static void main(String[] args) {
      Display display = new Display();
      Shell shell = new Shell(display);
      shell.setLayout(new FillLayout());
      JavaFxBrowser javaFxBrowser = new JavaFxBrowser(shell);
      shell.open();
      while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
      display.sleep();
      }
      display.dispose();
      }
      }

      SWT_GTK3=1 - this environmental variable should be added

            ddhill David Hill (Inactive)
            ibuziukjfx Ilya Buziuk (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: