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

[SWT] No possibility to select text in FX content by using mouse dragging


    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 8u25
    • Fix Version/s: 8u60
    • Component/s: javafx
    • Environment:

      Windows7, JRE 8u25, (org.eclipse.swt_3.6.2.v3659c / org.eclipse.swt_3.103.1.v20140903-1938)

    • Subcomponent:
    • Verification:
      Not verified


      When Browser content is loaded I am not able to select any text on it by using mouse dragging.
      There is one case when text is selecting and highlighting (mouse double click on any word selecting it).

      Tested with 8u25 and
      - org.eclipse.swt_3.6.2.v3659c
      - org.eclipse.swt_3.103.1.v20140903-1938.jar

      It is blocker for me. I can't deliver solution base on Webkit which has no possibility to select text by dragging mouse over the text.

      I am providing short simple example which allows to reproduce that bug.

      import javafx.beans.value.ChangeListener;
      import javafx.beans.value.ObservableValue;
      import javafx.concurrent.Worker.State;
      import javafx.embed.swt.FXCanvas;
      import javafx.scene.Scene;
      import javafx.scene.web.WebView;
      import org.eclipse.swt.SWT;
      import org.eclipse.swt.layout.FillLayout;
      import org.eclipse.swt.widgets.Display;
      import org.eclipse.swt.widgets.Shell;

      public class DragSelectionWebkitIssue
          public static void main(String[] args)
              Display display = new Display();
              Shell shell = new Shell(display);
              shell.setLayout(new FillLayout());
              FXCanvas canvas = new FXCanvas(shell, SWT.NONE);

              WebView webView = new WebView();
              Scene scene = new Scene(webView);


              shell.setSize((int) scene.getWidth(), (int) scene.getHeight());

              while (!shell.isDisposed())
                  if (!display.readAndDispatch())

          private static ChangeListener <? super State> getInitialProgressListener(WebView webView)
              return new ChangeListener <State>()

                  public void changed(ObservableValue <? extends State> observable, State oldState,
                      State newState)
                      String location = webView.getEngine().getLocation();
                      System.out.println("Loading: " + location + " - " + newState);




            • Assignee:
              kcr Kevin Rushforth
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created: