-
Bug
-
Resolution: Fixed
-
P3
-
8u20
-
Win 8.1, Intel i7, Eclipse Luna, Java 8u25 or 8u40
With ScrollPane content composed of Labels (text only) within HBox-es within a VBox, all with borders, scrolling up& down (even slowly) introduces distortions (borders get "lost");
I do not recall seeing this issue in earlier Java 8 versions.
The following code exhibits the behavior on my system:
import javafx.application.Application;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class TestSP extends Application {
;
private final String STYLE = ""
+"-fx-alignment: center;"
+"-fx-border-color: black;"
+"-fx-border-width: 2;"
+"-fx-border-radius: 8;"
+"-fx-padding: 3;"
+"-fx-text-wrap: true;"
;
VBox root = new VBox();
Scene scene = new Scene(root);
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setWidth(800);
primaryStage.setHeight(600);
primaryStage.setScene(scene);
primaryStage.show();
root.getChildren().add(createPanel());
}
int ind=0;
private Node createBlock() {
HBox blk = new HBox(5);
blk.setStyle(STYLE);
for (int i=0;i<6;i++) {
Label l= new Label("This is label #"+ind++);
l.setStyle(STYLE);
blk.getChildren().add(l);
}
return blk;
}
private ScrollPane createPanel() {
ScrollPane sp = new ScrollPane();
VBox.setVgrow(sp, Priority.ALWAYS);
VBox vb = new VBox(10);
sp.setContent(vb);
for (int i=0;i<20;i++)
vb.getChildren().add(createBlock());
sp.setStyle(STYLE);
return sp;
}
}
I do not recall seeing this issue in earlier Java 8 versions.
The following code exhibits the behavior on my system:
import javafx.application.Application;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class TestSP extends Application {
;
private final String STYLE = ""
+"-fx-alignment: center;"
+"-fx-border-color: black;"
+"-fx-border-width: 2;"
+"-fx-border-radius: 8;"
+"-fx-padding: 3;"
+"-fx-text-wrap: true;"
;
VBox root = new VBox();
Scene scene = new Scene(root);
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setWidth(800);
primaryStage.setHeight(600);
primaryStage.setScene(scene);
primaryStage.show();
root.getChildren().add(createPanel());
}
int ind=0;
private Node createBlock() {
HBox blk = new HBox(5);
blk.setStyle(STYLE);
for (int i=0;i<6;i++) {
Label l= new Label("This is label #"+ind++);
l.setStyle(STYLE);
blk.getChildren().add(l);
}
return blk;
}
private ScrollPane createPanel() {
ScrollPane sp = new ScrollPane();
VBox.setVgrow(sp, Priority.ALWAYS);
VBox vb = new VBox(10);
sp.setContent(vb);
for (int i=0;i<20;i++)
vb.getChildren().add(createBlock());
sp.setStyle(STYLE);
return sp;
}
}
- duplicates
-
JDK-8133031 Severe graphical glitches when using GridPanes and ScrollPane
-
- Closed
-
- relates to
-
JDK-8093051 ScrollPane is not refreshing its contents
-
- Resolved
-
-
JDK-8089239 Fix and enable scroll pane caching optimization
-
- Open
-