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

Gtk: ContextMenu doesn't appear on tabs in tabpane.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 7u6
    • fx2.1
    • javafx
    • Linux Ubuntu 10.04.
      JDK6, JDK7
      2.1.0b17

      run attached Code:

      import javafx.application.Application;
      import javafx.geometry.Side;
      import javafx.scene.Scene;
      import javafx.scene.control.*;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class Main extends Application {

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

          @Override
          public void start(Stage stage) throws Exception {
              TabPane tabPane = new TabPane();
              tabPane.getTabs().clear();
              for (int i = 0; i < 3; i++) {
                  Tab tab = new Tab("Tab " + i);
                  tab.setTooltip(new Tooltip("Tab " + i));
                  ContextMenu menu = new ContextMenu();
                  for (int j = 0; j < 3; j++) {
                      menu.getItems().add(new MenuItem("Tab " + i + " menu item " + j));
                  }
                  tab.setContextMenu(menu);
                  tabPane.getTabs().add(tab);
              }
              tabPane.setSide(Side.TOP);

              VBox vb = new VBox();
              vb.getChildren().addAll(tabPane);
              Scene scene = new Scene(vb, 300, 300);
              stage.setScene(scene);
              stage.show();
          }
      }

      I click using right mouse button on tabs and ContextMenu doesn't appear.

            msladecek Martin Sládeček
            akirov Alexander Kirov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: