Since the buttons are effectively private to the tab pane's skin, the "right" 
way to do this would probably be to create a custom subclass of 
TerraTabPaneSkin that knows about the buttons and can attach a listener to 
them. However, you could probably hack support for this by registering a mouse 
listener on the TabPane itself, then calling tabPane.getComponentAt(x, y). If 
the component is an instance of TerraTabPaneSkin.TabButton, then the user has 
clicked on the tab button.

On May 13, 2011, at 2:53 AM, Edvin Syse wrote:

> I would like a middle mousebutton click to close the active tab in a TabPane, 
> using the same action that happens when one click the X in the tab. Where 
> should I attach a listener to make this happen?
> 
> -- Edvin

Reply via email to