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

WebView display extra character for multiline text.

XMLWordPrintable

    • web
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      When WebView displays a html with multiline text, some extra character showed at the locations where text lines concatenate.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Works fine for JavaFX SDK 21.0.2.
      ACTUAL -
      Extra characters superimposed on letters A and Y, see screenshot below.

      ---------- BEGIN SOURCE ----------
      Run the following code,

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.layout.VBox;
      import javafx.scene.web.WebEngine;
      import javafx.scene.web.WebView;
      import javafx.stage.Stage;

      public class WebViewTest extends Application {

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

            @Override
            public void start(Stage arg0) throws Exception {
                  
              WebView webView = new WebView();
              WebEngine webEngine = webView.getEngine();
              webEngine.loadContent(HTML);            
       
              VBox vBox = new VBox();
              vBox.getChildren().add(webView);
              Scene scene = new Scene(vBox);
              Stage stage = new Stage();
              stage.setMaxHeight(150);
              stage.setScene(scene);
              stage.show();
          }
            
            private static String HTML = """
                  <html>
                        <head>
                              <style>
                                     body {font-size: 20pt;}
                              </style>
                        </head>
                        <body>
                              <p>
                                    Very short text.
                                    Another short text.
                                    Yet another short text.
                              </p>
                        </body>
                  </html>     
            """;

      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      Unknown

        1. Screenshot.png
          Screenshot.png
          6 kB
        2. unknown_chars.png
          unknown_chars.png
          29 kB
        3. App.java
          0.9 kB

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

              Created:
              Updated:
              Resolved: