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

[TouchEvent, PopupControl] Using a ListView in PopupControl generates a lot of TouchEvent NPE

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u20
    • Fix Version/s: 8u20
    • Component/s: javafx
    • Environment:

      Mac OSX Mavericks 10.9.2
      JDK: 1.8.0_20-ea-b05
      JavaFx: 8.0.20-ea-b05

      Description

      1) Run the sample demo application below
      2) Click on the "open popup" button
      3) Navigate in the list using the MacBook touchpad (two fingers up/down)
      4) NullPointerException occurred

      [Logs]
      Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
      at com.sun.glass.ui.TouchInputSupport.notifyBeginTouchEvent(TouchInputSupport.java:82)
      at com.sun.glass.ui.mac.MacTouchInputSupport.notifyEndTouchEvent(MacTouchInputSupport.java:85)
      at com.sun.glass.ui.mac.MacGestureSupport.notifyEndTouchEvent(MacGestureSupport.java:81)
      (repeated thousand of time)

      [Demo.java]
      import javafx.application.Application;
      import javafx.collections.FXCollections;
      import javafx.collections.ObservableList;
      import javafx.event.ActionEvent;
      import javafx.scene.Node;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.Label;
      import javafx.scene.control.ListView;
      import javafx.scene.control.PopupControl;
      import javafx.scene.control.Skin;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class Demo extends Application {
          class MyPopupControlSkin implements Skin<PopupControl> {
              private final PopupControl popupControl;
              private final Node node;
              public MyPopupControlSkin(final PopupControl control) {
                  this.popupControl = control;
                  ObservableList<Number> data = FXCollections.observableArrayList();
                  for( int i = 0; i < 400; i++ ) {
                      data.add(i);
                  }
                  this.node = new VBox(new Label("Popup control"), new ListView(data));
              }
              @Override public PopupControl getSkinnable() {
                  return popupControl;
              }
              @Override public Node getNode() {
                  return node;
              }
              @Override public void dispose() {}
          }
           
          @Override public void start(Stage primaryStage) {
              Button btn = new Button("Open popup");
              btn.setOnAction((ActionEvent e) -> {
                  PopupControl popup = new PopupControl();
                  popup.setSkin(new MyPopupControlSkin(popup));
                  popup.show(btn, primaryStage.getX() + 160, primaryStage.getY() + 30);
              });
              primaryStage.setScene(new Scene(btn, 150, 50));
              primaryStage.show();
          }

          public static void main(String[] args) {
              launch(args);
          }
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pchelko Petr Pchelko (Inactive)
              Reporter:
              badisijfx Badisi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported: