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

[ContextMenu] Disabled Menu Rollover never receives Mouse hover

    Details

      Description

      This is a minor, and 100% cosmetic issue, but the Devil is in the details..

      When you add a disabled MenuItem into a ContextMenu, everything is as expected.

      When you add a disabled Menu into a ContextMenu, the disabled Menu never appears to receive mouse over events, and a bit confusingly, the MenuItems next to this disabled menu continue to have "mouse over effect", even if the disabled Menu is actually hovered.

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.ContextMenu;
      import javafx.scene.control.Label;
      import javafx.scene.control.Menu;
      import javafx.scene.control.MenuItem;
      import javafx.stage.Stage;

      public class MenuTest extends Application {
      @Override
      public void start(Stage stage) throws Exception {
      Label root = new Label();

      ContextMenu menu = new ContextMenu();

      menu.getItems().add(new MenuItem("MenuItem 1"));
      menu.getItems().add(new Menu("Menu 1"));
      menu.getItems().add(new MenuItem("MenuItem 2"));
      menu.getItems().add(new MenuItem("MenuItem 3"));
      menu.getItems().add(new MenuItem("MenuItem 4"));

      menu.getItems().get(1).setDisable(true);
      menu.getItems().get(4).setDisable(true);

      root.setContextMenu(menu);

      Scene scene = new Scene(root, 400, 400);
      stage.setScene(scene);
      stage.show();
      }

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

        Attachments

          Activity

            People

            • Assignee:
              aghaisas Ajit Ghaisas
              Reporter:
              amjfx AM (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: