Right Align Top Tabs in JavaFX

1.5k views Asked by At

Is it possible to right align tabs at the top of a TapPane? I'm referring to the whole set of tabs and not the label text inside a tab.

I've already tried something like this:

#main-tabs .tab-pane:top *.tab-header-area {
    -fx-alignment: CENTER_RIGHT;
}

as well as tricking it with CSS padding:

#main-tabs .tab-pane:top *.tab-header-area {
    -fx-padding: 0.416667em 100% 0.0em 0%;
}

Neither appears to work. I can manually change the left padding using fixed sizes but that doesn't help on a resizable stage. I can't seem to figure out how to keep the tabs right justified.

1

There are 1 answers

0
Mohamed Salah On

if you using (scene builder) you can do it through the following steps:

  1. Select the TabPane
  2. In the Properties find Node Orientation and select (Right to Left)