Button in JTabbedPane tab
Greetings,i'd like to have a button on every tab in JTabbedPane, like close button in NetBeans when you edit the code. By default, you can put an icon only. Do you guys know how to do that?thanks in advence.
The best, and 'proper,' way of doing it is to implement your own TabbedPaneUI, probably extending one of the existing ones. It's not really trivial though :o)
If you can wait another couple of months (or if you are willing to use the beta version), you can use the new JTabbedPane features in Java 6 (Mustang). Have a look at the method setTabComponentAt:
[url http://download.java.net/jdk6/docs/api/javax/swing/JTabbedPane.html#setTabComponentAt(int,%20java.awt.Component)]setTabComponentAt[/url]