public boolean accept(AWTEvent event) {
if (isClick(event)) {
MouseEvent me = (MouseEvent)event;
JTabbedPane tp = tabbedPane = (JTabbedPane)me.getComponent();
TabbedPaneUI ui = tp.getUI();
int index = ui.tabForCoordinate(tp, me.getX(), me.getY());
if (index != -1) {
setStatus("Selecting tab '" + tp.getTitleAt(index));
init(SE_CLICK);
return true;
}
if (Platform.isOSX()) {
int xmin = tp.getWidth();
int xmax = 0;
int ymin = tp.getHeight();
int ymax = 0;
for (int i=0;i < tp.getTabCount();i++) {
Rectangle rect = ui.getTabBounds(tp, i);
if (rect.x >= 0) {
xmin = Math.min(rect.x, xmin);
xmax = Math.max(rect.x + rect.width, xmax);
ymin = Math.min(rect.y, ymin);
ymax = Math.max(rect.y + rect.height, ymax);