Java: "Add Tab Button" for a JTabbedPane

Martijn Courteaux picture Martijn Courteaux · Dec 28, 2009 · Viewed 9.7k times · Source

Is it possible to add a button to a tabbed pane like in firefox.

enter image description here

The plus-button is what I want.

Thanks

Answer

Carl Smotricz picture Carl Smotricz · Dec 28, 2009

I think you should be able to manage it by building your own JTabbedPaneUI and setting it on the JTabbedPane using setUI.

Your ComponentUI has methods to get a hold of the accessible children. If you specify a JButton and a JLabel then you may be in business.

I haven't attempted this myself though. This is "at your own risk" :)