jtp.putClientProperty(
SubstanceLookAndFeel.TABBED_PANE_CLOSE_BUTTONS_PROPERTY,
Boolean.TRUE);
// create a custom implementation of TabCloseCallback interface.
TabCloseCallback closeCallback = new TabCloseCallback() {
public TabCloseKind onAreaClick(JTabbedPane tabbedPane,
int tabIndex, MouseEvent mouseEvent) {
if (mouseEvent.getButton() != MouseEvent.BUTTON3)
return TabCloseKind.NONE;
if (mouseEvent.isShiftDown()) {