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

Menu does not fully show last menu item

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      openjdk version "22.0.1" 2024-04-16
      OpenJDK Runtime Environment (build 22.0.1+8-16)
      OpenJDK 64-Bit Server VM (build 22.0.1+8-16, mixed mode, sharing)

      JavaFX: 22, 22.0.1

      A DESCRIPTION OF THE PROBLEM :
      When opening menu from menu bar or context menu the last menu item is not shown properly. Like menu drop down is shorter a bit than needed to show the last string fully.

      REGRESSION : Last worked in version 22.0.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Show any menu or context menu in JavaFX application.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      All menu items are shown properly with full text.
      ACTUAL -
      Last (bottom) menu item is shown with string cut horizontally by half.

      ---------- BEGIN SOURCE ----------
      package test;

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Menu;
      import javafx.scene.control.MenuBar;
      import javafx.scene.control.MenuItem;
      import javafx.scene.layout.BorderPane;
      import javafx.stage.Stage;

      class MainWindowController {
          public MainWindowController(Stage stage) {
              var menu = new Menu("Menu", null,
                      new MenuItem("Item 1"),
                      new MenuItem("Item 2"),
                      new MenuItem("Item 3")
              );

              var root = new BorderPane(null, new MenuBar(menu), null, null, null);

              var scene = new Scene(root);
              stage.setTitle("Title");
              stage.setScene(scene);
              stage.setWidth(800);
              stage.setHeight(600);
          }
      }


      public final class TestApplication extends Application {
          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(Stage stage) throws Exception {
              new MainWindowController(stage);
              stage.show();
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      There is no workaround beside downgrading JavaFX version to JavaFX 21.0.3.

      FREQUENCY : always


        1. MenuItems.png
          14 kB
          Anupam Dev
        2. TestApplication.java
          1 kB
          Anupam Dev

            adev Anupam Dev
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: