Add Layouts on TabPane JavaFX

2k views Asked by At

i have a quick question. I want to build an UI with JavaFX. It should have tabs, each with some content. The problem that I have is, I dont know how to arrange the content in the tabs properly. Is there a possibility to add a Layout to the tabs? Like a Grid oder a Border Pane? And is it possible to have a different layout for each tab?

Thanks for the help!

1

There are 1 answers

0
Sarfaraz Khan On BEST ANSWER

Not sure if Tab allows that as while setting component we only have setContent(Node) mehtod but Tab is like a container (Control)you can add a container (any children of Node object) like Border Pane ,Flow Pane which support Laying out their children.

 Tab tab = new Tab();

BorderPane borderPane = new BorderPane();
//Add some in borderPane
tab.setContent(borderPane);