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

javafx ScrollPane background painting bug (build 1.8.0-ea-b123, tried on windows 64-bit and Ubuntu 32 bit)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8
    • javafx
    • build 1.8.0-ea-b123, tried on windows 64-bit and Ubuntu 32 bit

      In the following small example the root is AnchorPane (background is yellow, but it is not visible). It contains a
      ScrollPane with green background. The ScrollPane contains an AnchorPane with red background, fixed height and width, the witdth is smaller than the width of the ScrollPane. If you start the example with JDK 8 the background of the ScrollPane where not covered with the red AnchorPane is not green. When you scroll down vertically using the scroll bar green lines appear in this area.
      With JDK 7 the background is green and there are no lines. The example consist of a java file and an fxml.

      Example java file:

      package scrollpanetest;

      import javafx.application.Application;
      import javafx.fxml.FXMLLoader;
      import javafx.scene.Parent;
      import javafx.scene.Scene;
      import javafx.stage.Stage;

      public class Test extends Application {

      @Override
      public void start(Stage stage) throws Exception {
      Parent root = FXMLLoader.load(getClass().getResource("test.fxml"));

      Scene scene = new Scene(root);

      stage.setScene(scene);
      stage.show();
      }

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

      }

      FXML file (test.fxml):

      <?xml version="1.0" encoding="UTF-8"?>

      <?import java.lang.*?>
      <?import java.util.*?>
      <?import javafx.scene.control.*?>
      <?import javafx.scene.layout.*?>
      <?import javafx.scene.paint.*?>

      <AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: yellow" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2">
        <children>
          <ScrollPane prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: lightgreen" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
            <content>
              <AnchorPane id="Content" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="1000.0" prefWidth="100.0" style="-fx-background-color: red" />
            </content>
          </ScrollPane>
        </children>
      </AnchorPane>

            jgiles Jonathan Giles
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: