source.setSelectedIndex(source.getSelectedIndex());
source.setSelectedIndex(-1);
			public void mouseClicked(MouseEvent evt) {				if (evt.getClickCount() == 2) {					JTabbedPane source = (JTabbedPane) evt.getSource();					View view = (View) source.getSelectedComponent();					if (view != null) {						// dont do anything if the click is not within the						// bounds of a tab						if (indexAtLocation(evt.getX(), evt.getY()) == -1)							return;						JPanel panel = new JPanel();						panel.setBackground(Color.WHITE);						JLabel tabsUndocked = new JLabel("", GUIUtilities.getAssetMapIcon("matrix_logo.png"), CENTER);						tabsUndocked.setVerticalTextPosition(JLabel.CENTER);						tabsUndocked.setHorizontalTextPosition(JLabel.CENTER);						tabsUndocked.setVerticalAlignment(JLabel.CENTER);						tabsUndocked.setHorizontalAlignment(JLabel.CENTER);						tabsUndocked.setBackground(Color.WHITE);						int fillerWidth = getWidth();						int fillerHeight = ( getHeight() / 3 ) ;						Dimension filler = new Dimension(fillerWidth,fillerHeight);						panel.add(new Box.Filler(filler,filler,filler), BorderLayout.NORTH);						panel.add(tabsUndocked, BorderLayout.CENTER);						source.setComponentAt(source.getSelectedIndex(), panel);						//source.setComponentAt(source.getSelectedIndex(), new JPanel());						UndockedView udView = new UndockedView(view, source.getSelectedIndex());						udView.setSize(300, 600);						GUIUtilities.showInScreenCenter(udView);						udView.toFront();						udView.setExtendedState(Frame.NORMAL);						udView.addWindowListener(REDOCK_HANDLER);						source.setEnabledAt(source.getSelectedIndex(), false);						for (int i = 0; i < source.getTabCount(); i++) {							if (i != source.getSelectedIndex() && source.isEnabledAt(i)) {								source.setSelectedIndex(i);								allUndocked = false;								break;							}							if (i == source.getTabCount() - 1) {								source.setSelectedIndex(source.getSelectedIndex());								allUndocked = true;							}						}						/*if (source.getSelectedIndex() - 1 == source.getTabCount()) {							source.setSelectedIndex(0);						} else {							source.setSelectedIndex(source.getSelectedIndex() + 1);						}*/					}				}			}