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

ListView: wrong scrollbar rendering, when we set custom shape or image border or another background

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • fx2.0
    • javafx

      To reproduce run following code



      import com.sun.javafx.collections.ObservableListWrapper;
      import java.util.Arrays;
      import javafx.application.Application;
      import javafx.collections.ObservableList;
      import javafx.scene.Parent;
      import javafx.scene.Scene;
      import javafx.scene.control.ListView;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class ListViewSample1 extends Application {

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

          private Parent getContent() {
              VBox box = new VBox(10);
              ListView list = new ListView();
              ObservableList<String> items = new ObservableListWrapper<String>(Arrays.asList("One", "Two", "Three", "Four", "Five", "Six", "long\n line\n long\n line long\n line\n long\n line"));
              list.setItems(items);
              list.setMaxWidth(100);
              list.setMaxHeight(100);
              list.setStyle("-fx-shape: "
                          + "\"M 50 50 L 150 50 L 100 150 Z\";-fx-background-color: red;");

              box.getChildren().add(list);
              return box;
          }

          public void start(Stage stage) {
              stage.setX(100);
              stage.setY(100);
              stage.setWidth(300);
              stage.setHeight(300);
              Scene scene = new Scene(getContent());
              stage.setScene(scene);
              stage.setVisible(true);
          }
      }

            miflemi Mick Fleming
            anazarov Andrey Nazarov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: