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

Display bug when reducing the size of a WebView programmatically through setMaxHeight

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 7u6
    • javafx
    • Windows 7 x64
      java version "1.7.0_13"
      Java(TM) SE Runtime Environment (build 1.7.0_13-b20)
      Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

    • web

      When reducing the height of a WebView by using setMaxHeight, the parts of the WebView that should be hidden stay on screen as if the window was not updated. Execute the code below and click the "reduce" button for testing :

      --- begin code
      import javafx.application.Application;
      import javafx.event.EventHandler;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.input.MouseEvent;
      import javafx.scene.layout.VBox;
      import javafx.scene.web.WebView;
      import javafx.stage.Stage;

      public class Main extends Application {
          public static void main(String[] args) {
              Application.launch(Main.class);
          }
          @Override
          public void start(Stage stage) throws Exception {
              Group root = new Group();
              Scene scene = new Scene(root, 600, 650);
              VBox layout = new VBox();
              root.getChildren().add(layout);
              stage.setScene(scene);
              stage.show();
              final WebView wv = new WebView();
              wv.setMaxHeight(600);
              wv.getEngine().loadContent("<!DOCTYPE html><html><head><title>test</title></head><body style='background-color: blue'></body></html>");
              Button reduceButton = new Button("reduce");
              reduceButton.setOnMouseClicked(new EventHandler<MouseEvent>() {
                  @Override
                  public void handle(MouseEvent arg0) {
                      wv.setMaxHeight(100);
                      wv.requestFocus();
                  }
              });
              layout.getChildren().addAll(reduceButton, wv);
          }
      }
      --- end code

        1. rt-28396.patch
          0.5 kB
          Martin Sládeček

            peterz Peter Zhelezniakov
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: