r.valbo
r.valbo

Reputation: 35

Add Layouts on TabPane JavaFX

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!

Upvotes: 3

Views: 2064

Answers (1)

Sarfaraz Khan
Sarfaraz Khan

Reputation: 2186

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);

Upvotes: 2

Related Questions