Maybe it is not necessary to add a JButton. Once you click a tab a
javax.swing.event.ChangeEvent is generated. So just add a ChangeListener on
the JTabbedPane to perform an action.

Otherwise you have to write your own javax.swing.plaf .TabbedPaneUI and add
your button there. For further info have a look at BasicTabbedPaneUI or
MultiTabbedPaneUI in the API doc and in the swing source code.

Regards,
Stefan

Perico wrote:

> Somebody have some idea to implement a JTabbedPane with a
> JButton (I mean a small icon) in their tabs in order to execute an
> action when this button is pressed?.
>
> I think there's no method in JTabbedPane to do this (I only saw
> a method to put an icon in a JTabbedPane, but an icon cannot have
> an action associated).
>
> Any ideas?.
>
> Thanks a lot.
>
> _______________________________________________
> Swing mailing list
> [EMAIL PROTECTED]
> http://eos.dk/mailman/listinfo/swing

_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to