Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Adding dynamically new tabs to a tab pane with a button

se32862378May 7 2013 — edited May 14 2013
In most modern internet browsers it is very easy and intuitive how to open a new tab in the same window.
Usually there is a small button with a "+" at the right of all the tabs. When this button is clicked a new tab is created and it receives the focus.

What is the simplest way to mimic this behavior in a JavaFX application ?. I am thinking in trying to add a "fake" tab with a "+" symbol. Then I may find out when such tab is clicked, and on that event I could dynamically create a new tab and give it the focus.
Is this the correct way to do it ?. Any small example illustrating the best way to implement this would be greatly appreciated.
This post has been answered by James_D on May 7 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 11 2013
Added on May 7 2013
10 comments
36,208 views