public void mouseClicked(MouseEvent e) { int x = e.getX(); int y = e.getY(); int currentTabIndex = -1; int tabCount = tabPane.getTabCount(); for (int i = 0; i < tabCount; i++) { if (rects[i].contains(x, y)) { currentTabIndex = i; break; } // if contains } // for i if (currentTabIndex >= 0) { Rectangle tabRect = rects[currentTabIndex]; x = x - tabRect.x; y = y - tabRect.y; if ((x >= 5) && (x <= 15) && (y >= 5) && (y <= 15)) { try { tabbedPane.remove(currentTabIndex); } catch (Exception ex) { ex.printStackTrace(); } } // if } // if currentTabIndex >= 0 System.gc(); } // mouseClicked
// ------------------------------------------------------------------------------------- public static void main(String[] args) { ClusterViewer view; if (args.length != 1) { System.err.println("usage: clusterViewer <baseUrl>"); System.exit(1); } view = new ClusterViewer(args[0].trim()); } // main
// ------------------------------------------------------------------------------------- public void doExit() { connector.disconnectFromGaggle(true); System.exit(0); }