Search code examples
cssjavafxborder-spacing

how to set border spacing in javafx


how to use border spacing property in javafx ?

Like in css for html

table.ex1 {
    border-collapse: separate;
    border-spacing: 10px 50px;
}

How do i use border spacing in javafx?

Inside a TabPane wherer i want to put a bottom border under each tab and my css is

.tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator {
    -fx-border-width: 4px;
    -fx-border-color: transparent transparent white transparent;


}

its working and i have nice bottom border but i need some more border spacing , so someone please tell me how to do that ?

thanks in advance.


Solution

  • .tab:top{
    -fx-background-color: transparent;
    -fx-border-insets: 0 0 0 0;
    -fx-border-color: white white white white ; 
    -fx-padding: 15px;
    }
    

    I think there is no border-spacing type property in javafx css but anyway you can do it in TabPane by -fx-padding property for tab.