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

Tooltip bigger than screen size blinks - shows and hides over and over again

XMLWordPrintable

    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Microsoft Windows [Version 10.0.18363.1198]
      openjdk version "11.0.5" 2019-10-15
      OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10)
      OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.5+10, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      Tooltip that is bigger than screen size hides right after showing. That is caused by sending mouse exit event to the stage, to which tooltip is displayed, because tooltip becomes the new stage that mouse entered in.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Run provided executable test case.
      2. Hover mouse under the "hover me" label.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      After 2. the tooltip should present for the default 5000 milliseconds (javafx.scene.control.Tooltip#showDurationProperty).
      ACTUAL -
      After 2. the tooltip is blinking - shows and hides over and over again

      ---------- BEGIN SOURCE ----------
      import java.util.stream.Collectors;
      import java.util.stream.IntStream;

      import javafx.application.Application;
      import javafx.geometry.Insets;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.control.Tooltip;
      import javafx.scene.layout.BorderPane;
      import javafx.stage.Stage;

      public class BigTooltipIssue
      {

          public static void main( String[] args )
          {
              System.err.println( Runtime.version().toString() );
              Application.launch( BigTooltipIssue.MainFx.class, args );
          }

          public static class MainFx extends Application
          {

              @Override
              public void start( final Stage primaryStage ) throws Exception
              {
                  System.err.println( System.getProperty( "javafx.version" ) );
                  final Label label = new Label( "hover me" );
                  final Tooltip tooltip = new Tooltip(
                      IntStream.range( 0, 200 ).mapToObj( i -> "LongText" ).collect( Collectors.joining() )
                          + IntStream.range( 0, 100 ).mapToObj( i -> "Line: " + i )
                          .collect( Collectors.joining( "\n" ) ) );
                  label.setTooltip( tooltip );
                  final BorderPane borderPane = new BorderPane( label );
                  borderPane.setPadding( new Insets( 5 ) );
                  Scene scene = new Scene( borderPane, 800, 600 );
                  primaryStage.setScene( scene );
                  primaryStage.show();
              }

          }

      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      We have not found any clean workaround.

      FREQUENCY : always


        1. BigTooltipIssue.java
          2 kB
          Praveen Narayanaswamy
        2. Capture_Tooltip_Blinking.JPG
          31 kB
          Praveen Narayanaswamy

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: