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

![enter image description here](https://i.stack.imgur.com/vtVsG.png)

The plus-button is what I want.

Thanks

Answer: 
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" :)
I have tried several solutions and came with this one:

```
import java.awt.Dimension;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;

public class TestTab {

    public static void main(String[] args) {
    JFrame parent = new JFrame();

    final JTabbedPane tabEntity = new JTabbedPane();
    tabEntity.addTab("Details", null, new JScrollPane());
    tabEntity.addTab("Context", null, new JScrollPane());
    tabEntity.addTab("", null, new JScrollPane());

    addButtonToTab(tabEntity);

    parent.add(tabEntity);
    parent.setSize(new Dimension(400, 200));
    parent.setVisible(true);
    }

    public static void addButtonToTab(final JTabbedPane tabEntity) {
    tabEntity.setTabComponentAt(tabEntity.getTabCount() - 1, new JButton(
        "+"));
    }
}

```

So you have:

[![Button near tab example](https://i.stack.imgur.com/mTXML.png)](https://i.stack.imgur.com/mTXML.png)