To reproduce run following code
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Control;
import javafx.scene.control.Label;
import javafx.scene.control.MenuItem;
import javafx.scene.control.ScrollBar;
import javafx.scene.control.SplitMenuButton;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class RegionBorder extends Application {
public static void main(String[] args) {
launch(args);
}
private Parent getContent() {
VBox list = new VBox(10);
Control[] controls = new Control[4];
controls[0] = new Button("Button");
controls[1] = new Label("Button");
controls[2] = new ScrollBar();
controls[3] = new SplitMenuButton(new MenuItem("SplitMenuButton"));
for (Control control : controls) {
control.setStyle("-fx-border-color: green;-fx-border-width:5px;");
list.getChildren().add(control);
}
return list;
}
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);
}
}
import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Control;
import javafx.scene.control.Label;
import javafx.scene.control.MenuItem;
import javafx.scene.control.ScrollBar;
import javafx.scene.control.SplitMenuButton;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class RegionBorder extends Application {
public static void main(String[] args) {
launch(args);
}
private Parent getContent() {
VBox list = new VBox(10);
Control[] controls = new Control[4];
controls[0] = new Button("Button");
controls[1] = new Label("Button");
controls[2] = new ScrollBar();
controls[3] = new SplitMenuButton(new MenuItem("SplitMenuButton"));
for (Control control : controls) {
control.setStyle("-fx-border-color: green;-fx-border-width:5px;");
list.getChildren().add(control);
}
return list;
}
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);
}
}
- duplicates
-
JDK-8114536 CSS: we can't set border of separator
- Closed
- is blocked by
-
JDK-8114683 Region should support insets property that adds border and padding together
- Closed