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

[CSS] Checkmark in CheckMenuItem is sometimes white and sometimes black, making it nearly unreadable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • 8u20
    • 8
    • javafx
    • Windows 7

      I've noticed, that the checkmark in a CheckMenuItem is white, when a Menu is shown for the first time.

      Because the background of our menus is white/bright (as it used to be in JavaFX 2.2), the checkmark is unreadable.

      But once the menu has been shown, it is black (readable) the next time you show the menu, which is very confusing to the user.

      Here's a sample code (run with Java 8):

      Click "Menu 1": The checkmark of the CheckMenuItem is white.
      Hover "Menu 2", then hover "Menu 1" again: The checkmark is now black.

      Please, if you know of any workaround, let me know, because unreadable menu items (even only the checkmark) is holding us back from moving to JavaFX 8.

      (I know, here the background is grey, making it always readable, but the bug remains the same).

      import javafx.application.Application;
      import javafx.geometry.Insets;
      import javafx.scene.Scene;
      import javafx.scene.control.CheckMenuItem;
      import javafx.scene.control.Menu;
      import javafx.scene.control.MenuBar;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class TestApp4 extends Application {
          public static void main(String[] args) throws Exception {
              launch(args);
          }


          public void start(final Stage stage) throws Exception {

              Application.setUserAgentStylesheet(STYLESHEET_CASPIAN);

              MenuBar menuBar = new MenuBar();

              Menu menu1 = new Menu("Menu 1");
              Menu menu2 = new Menu("Menu 2");
              CheckMenuItem checkMenuItem = new CheckMenuItem("Test");
              checkMenuItem.setSelected(true);
              menu1.getItems().addAll(checkMenuItem);

              menuBar.getMenus().addAll(menu1, menu2);

              Scene scene = new Scene(menuBar);
              stage.setScene(scene);
              stage.show();
          }
      }

            dgrieve David Grieve
            cschudtjfx Christian Schudt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: