-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
fx2.0
One would expect the scroll bar to be red. Change the child relationship to descendant and the selector matches.
Knowing that the skin is a child of the ScrollBar, .myParent > * > .scroll-bar should work but does not.
/*
* demo.css
*/
.myParent > .scroll-bar {
-fx-border-color: red;
}
package javaapplication37;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ScrollBar;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
/**
*
* @author jfdenise
*/
public class JavaApplication37 extends Application {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
AnchorPane ap = new AnchorPane();
ap.getStyleClass().add("myParent");
ScrollBar sb = new ScrollBar();
ap.getChildren().add(sb);
Scene scene = new Scene(ap, 100, 100);
scene.getStylesheets().add(JavaApplication37.class.getResource("demo.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.setVisible(true);
}
}
Knowing that the skin is a child of the ScrollBar, .myParent > * > .scroll-bar should work but does not.
/*
* demo.css
*/
.myParent > .scroll-bar {
-fx-border-color: red;
}
package javaapplication37;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ScrollBar;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
/**
*
* @author jfdenise
*/
public class JavaApplication37 extends Application {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
AnchorPane ap = new AnchorPane();
ap.getStyleClass().add("myParent");
ScrollBar sb = new ScrollBar();
ap.getChildren().add(sb);
Scene scene = new Scene(ap, 100, 100);
scene.getStylesheets().add(JavaApplication37.class.getResource("demo.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.setVisible(true);
}
}