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

Gtk: Behavior of events sending changed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • javafx
    • 8.0b65x64, linux ubuntu 12.04x64. d3d

      Changed between 8.0b64 and 8.0b65.

      Run the application:

      import javafx.application.Application;
      import javafx.collections.FXCollections;
      import javafx.collections.ObservableList;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.control.MenuButton;
      import javafx.scene.control.MenuItem;
      import javafx.scene.input.MouseEvent;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class JavaApplication6 extends Application {

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

          @Override
          public void start(Stage stage) throws Exception {
              final MenuButton testMenuButton = new MenuButton();

              ObservableList<MenuItem> testMenuItems = FXCollections.observableArrayList();

              for (int indx = 1; indx <= 5; indx++) {
                  MenuItem mi = new MenuItem();
                  mi.setText("Test Menu Item-" + indx);
                  testMenuItems.add(mi);
              }

              testMenuButton.getItems().addAll(testMenuItems);
              testMenuButton.setOnMousePressed(new EventHandler<MouseEvent>() {

                  @Override
                  public void handle(MouseEvent t) {
                      System.out.println("A");
                      testMenuButton.show();
                  }
              });
              testMenuButton.setOnMouseReleased(new EventHandler<MouseEvent>() {

                  @Override
                  public void handle(MouseEvent me) {
                      System.out.println("B");
                      testMenuButton.hide();
                  }
              });
              
              VBox vb = new VBox();
              vb.getChildren().addAll(testMenuButton);
              Scene scene = new Scene(vb, 300, 300);
              stage.setScene(scene);
              stage.show();
          }
      }

      Click on the button, and click somewhere on the scene (according to some bug, popup doesn't appear at first click).
      Press on button, and move cursor somewhere on the scene.
      Release button. Release event didn't come (but it comes on b64) and popup was not closed.

            azvegint Alexander Zvegintsev
            akirov Alexander Kirov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: