@Override
		public void layoutContainer(Container parent) {
			// append some padding to force the optional icon and button
			// text to the left, so it looks nicer
			for (int i=0;  i<tabPane.getTabCount();  i++) {
				String tabTitle = tabPane.getTitleAt(i);
				if (! tabTitle.endsWith(TITLE_PADDING)) {
					tabPane.setTitleAt(i, tabTitle + TITLE_PADDING);
				}
			}
			
			super.layoutContainer(parent);

			// Ensure that there are at least as many close buttons as tabs
			while(tabPane.getTabCount() > closeButtons.size()) {
				closeButtons.add(new CloseButton(closeButtons.size()));
			}

			// Add close buttons for each of the tabs, to the far-right side of the
			// tab heading
			int tab = 0;
			Rectangle rect = new Rectangle();
			for( ;  tab<tabPane.getTabCount();  tab++) {
				rect = getTabBounds(tab, rect);
				JButton closeButton = closeButtons.get(tab);

				//shift the close button 3 down from the top of the pane and 20 to the left
				closeButton.setLocation(rect.x+rect.width-20, rect.y+5);
				closeButton.setSize(15,15);
				tabPane.add(closeButton);
			}

			// Remove any extra close buttons
			for( ;  tab<closeButtons.size();  tab++) {
				tabPane.remove(closeButtons.get(tab));
			}

		}