Reputation: 16661
I want to remove top and bottom border of Borderpane.
I am using the following css but its removing all the borders.
.borderpane-container {
-fx-background-color: #ffffff;
-fx-box-border: #ffffff;
}
Is there a way to only remove top and bottom border ?
Upvotes: 0
Views: 5950
Reputation: 2917
Well setting -fx-border-width
works fine with me. Here is a small example :
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
public class BorderExample extends Application {
@Override
public void start(Stage stage) throws Exception {
BorderPane pane = new BorderPane();
pane.setCenter(new Label("Hello there"));
pane.setStyle("-fx-border-color : black; -fx-border-width : 0 5 ");
stage.setScene(new Scene(pane,200,200));
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Of course you can do the same loading an external css file from resources like
#myPane{
-fx-border-color : black;
-fx-border-width : 0 5;
}
In case I didn't understand you correctly let me know.
Upvotes: 2