tinku
tinku

Reputation: 341

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.

Upvotes: 1

Views: 4073

Answers (2)

tinku
tinku

Reputation: 341

.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.

Upvotes: 1

James_D
James_D

Reputation: 209330

Add some -fx-border-insets. Something like

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

}

Check the CSS documentation for Region for details.

Upvotes: 0

Related Questions