Button in JTabbedPane Title

Hi all
I am Using JTabbedPane I need to include button for close within every tab. How I Do this one using swings

hi!
for that you need to use the javax.swing.plaf.basic.BasicTabbedPaneUI class. i wrote
package una.common.file.vc.gui.control;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Event;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.LayoutManager;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ContainerEvent;
import java.awt.event.ContainerListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.image.BufferedImage;
import java.util.EventListener;
import java.util.Hashtable;
import java.util.Vector;
import javax.swing.AbstractAction;
import javax.swing.ActionMap;
import javax.swing.Icon;
import javax.swing.InputMap;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JTabbedPane;
import javax.swing.JViewport;
import javax.swing.KeyStroke;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.SoftBevelBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.ActionMapUIResource;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.InputMapUIResource;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.basic.BasicArrowButton;
import javax.swing.plaf.basic.BasicHTML;
import javax.swing.plaf.basic.BasicTabbedPaneUI;
import javax.swing.text.View;
import una.common.file.vc.gui.VCResource;
* UI for <code>VCTabbedPane</code>.
* <p>
* Credits to:
public class VCTabPaneUI extends BasicTabbedPaneUI implements ActionListener
     // Instance variables initialized at installation
     private ContainerListener          containerListener;
     private Vector                         htmlViews;
     private Hashtable                    mnemonicToIndexMap;
      * InputMap used for mnemonics. Only non-null if the JTabbedPane has
      * mnemonics associated with it. Lazily created in initMnemonics.
     private InputMap                    mnemonicInputMap;
     // For use when tabLayoutPolicy = SCROLL_TAB_LAYOUT
     protected ScrollableTabSupport     tabScroller;
     private int                              tabCount;
     protected MyMouseMotionListener     motionListener;
     // UI creation
     private static final int          INACTIVE                    = 0;
     private static final int          OVER                         = 1;
     private static final int          PRESSED                         = 2;
     protected static final int          BUTTONSIZE                    = 15;
     protected static final int          WIDTHDELTA                    = 5;
     private static final Border          PRESSEDBORDER               = new SoftBevelBorder(
                                                                                     SoftBevelBorder.LOWERED);
     private static final Border          OVERBORDER                    = new SoftBevelBorder(
                                                                                     SoftBevelBorder.RAISED);
     private BufferedImage               closeImgB;
     private BufferedImage               closeImgI;
     private JButton                         closeB;
     private int                              overTabIndex               = -1;
     private int                              closeIndexStatus          = INACTIVE;
     private int                              maxIndexStatus               = INACTIVE;
     private boolean                         mousePressed               = false;
     private boolean                         isCloseButtonEnabled     = true;
     private JPopupMenu                    actionPopupMenu               = null;
     private JMenuItem                    closeItem                    = null;
     private JMenuItem                    closeOthers                    = null;
     private JMenuItem                    closeAll                    = null;
     public VCTabPaneUI()
          super();
          closeImgB = new BufferedImage(BUTTONSIZE, BUTTONSIZE,
                    BufferedImage.TYPE_4BYTE_ABGR);
          closeImgI = new BufferedImage(BUTTONSIZE, BUTTONSIZE,
                    BufferedImage.TYPE_4BYTE_ABGR);
          closeB = new JButton("X");
          closeB.setSize(BUTTONSIZE, BUTTONSIZE);
          actionPopupMenu = new JPopupMenu();
          closeItem = new JMenuItem(VCResource.getString("CLOSE"));
          closeOthers = new JMenuItem(VCResource.getString("CLOSE_OTHERS"));
          closeAll = new JMenuItem(VCResource.getString("CLOSE_ALL"));
          actionPopupMenu.add(closeItem);
          actionPopupMenu.add(closeOthers);
          actionPopupMenu.add(closeAll);
          closeItem.addActionListener(this);
          closeOthers.addActionListener(this);
          closeAll.addActionListener(this);
     protected boolean isOneActionButtonEnabled()
          return isCloseButtonEnabled;
     public boolean isCloseEnabled()
          return isCloseButtonEnabled;
     public void setCloseIcon(boolean b)
          isCloseButtonEnabled = b;
     protected int calculateTabWidth(int tabPlacement, int tabIndex,
               FontMetrics metrics)
          int delta = 2;
          if (!isOneActionButtonEnabled())
               delta += 6;
          else
               if (isCloseButtonEnabled)
                    delta += BUTTONSIZE + WIDTHDELTA;
          return super.calculateTabWidth(tabPlacement, tabIndex, metrics) + delta;
     protected int calculateTabHeight(int tabPlacement, int tabIndex,
               int fontHeight)
          return super.calculateTabHeight(tabPlacement, tabIndex, fontHeight) + 5;
     protected void layoutLabel(int tabPlacement, FontMetrics metrics,
               int tabIndex, String title, Icon icon, Rectangle tabRect,
               Rectangle iconRect, Rectangle textRect, boolean isSelected)
          textRect.x = textRect.y = iconRect.x = iconRect.y = 0;
          View v = getTextViewForTab(tabIndex);
          if (v != null)
               tabPane.putClientProperty("html", v);
          SwingUtilities.layoutCompoundLabel((JComponent) tabPane, metrics,
                    title, icon, SwingUtilities.CENTER, SwingUtilities.LEFT,
                    SwingUtilities.CENTER, SwingUtilities.CENTER, tabRect,
                    iconRect, textRect, textIconGap);
          tabPane.putClientProperty("html", null);
          iconRect.x = tabRect.x + 8;
          textRect.x = iconRect.x + iconRect.width + textIconGap;
     protected MouseListener createMouseListener()
          return new MyMouseHandler();
     protected ScrollableTabButton createScrollableTabButton(int direction)
          return new ScrollableTabButton(direction);
     protected Rectangle newCloseRect(Rectangle rect)
          int dx = rect.x + rect.width;
          int dy = (rect.y + rect.height) / 2 - 6;
          return new Rectangle(dx - BUTTONSIZE - WIDTHDELTA, dy, BUTTONSIZE,
                    BUTTONSIZE);
     protected Rectangle newMaxRect(Rectangle rect)
          int dx = rect.x + rect.width;
          int dy = (rect.y + rect.height) / 2 - 6;
          if (isCloseButtonEnabled)
               dx -= BUTTONSIZE;
          return new Rectangle(dx - BUTTONSIZE - WIDTHDELTA, dy, BUTTONSIZE,
                    BUTTONSIZE);
     protected void updateOverTab(int x, int y)
          if (overTabIndex != (overTabIndex = getTabAtLocation(x, y)))
               tabScroller.tabPanel.repaint();
     protected void updateCloseIcon(int x, int y)
          if (overTabIndex != -1)
               int newCloseIndexStatus = INACTIVE;
               Rectangle closeRect = newCloseRect(rects[overTabIndex]);
               if (closeRect.contains(x, y))
                    newCloseIndexStatus = mousePressed ? PRESSED : OVER;
               if (closeIndexStatus != (closeIndexStatus = newCloseIndexStatus))
                    tabScroller.tabPanel.repaint();
//     protected void updateMaxIcon(int x, int y)
//          if (overTabIndex != -1)
//               int newMaxIndexStatus = INACTIVE;
//               Rectangle maxRect = newMaxRect(rects[overTabIndex]);
//               if (maxRect.contains(x, y))
//                    newMaxIndexStatus = mousePressed ? PRESSED : OVER;
//               if (maxIndexStatus != (maxIndexStatus = newMaxIndexStatus))
//                    tabScroller.tabPanel.repaint();
     private void setTabIcons(int x, int y)
          // if the mouse isPressed
          if (!mousePressed)
               updateOverTab(x, y);
          if (isCloseButtonEnabled)
               updateCloseIcon(x, y);
     public static ComponentUI createUI(JComponent c)
          return new VCTabPaneUI();
      * Invoked by <code>installUI</code> to create a layout manager object to
      * manage the <code>JTabbedPane</code>.
      * @return a layout manager object
      * @see TabbedPaneLayout
      * @see javax.swing.JTabbedPane#getTabLayoutPolicy
     protected LayoutManager createLayoutManager()
          return new TabbedPaneScrollLayout();
      * In an attempt to preserve backward compatibility for programs which have
      * extended BasicTabbedPaneUI to do their own layout, the UI uses the
      * installed layoutManager (and not tabLayoutPolicy) to determine if
      * scrollTabLayout is enabled.
      * Creates and installs any required subcomponents for the JTabbedPane.
      * Invoked by installUI.
      * @since 1.4
     protected void installComponents()
          if (tabScroller == null)
               tabScroller = new ScrollableTabSupport(tabPane.getTabPlacement());
               tabPane.add(tabScroller.viewport);
               tabPane.add(tabScroller.scrollForwardButton);
               tabPane.add(tabScroller.scrollBackwardButton);
      * Removes any installed subcomponents from the JTabbedPane. Invoked by
      * uninstallUI.
      * @since 1.4
     protected void uninstallComponents()
          tabPane.remove(tabScroller.viewport);
          tabPane.remove(tabScroller.scrollForwardButton);
          tabPane.remove(tabScroller.scrollBackwardButton);
          tabScroller = null;
     protected void installListeners()
          if ((propertyChangeListener = createPropertyChangeListener()) != null)
               tabPane.addPropertyChangeListener(propertyChangeListener);
          if ((tabChangeListener = createChangeListener()) != null)
               tabPane.addChangeListener(tabChangeListener);
          if ((mouseListener = createMouseListener()) != null)
               tabScroller.tabPanel.addMouseListener(mouseListener);
          if ((focusListener = createFocusListener()) != null)
               tabPane.addFocusListener(focusListener);
          // PENDING(api) : See comment for ContainerHandler
          if ((containerListener = new ContainerHandler()) != null)
               tabPane.addContainerListener(containerListener);
               if (tabPane.getTabCount() > 0)
                    htmlViews = createHTMLVector();
          if ((motionListener = new MyMouseMotionListener()) != null)
               tabScroller.tabPanel.addMouseMotionListener(motionListener);
     protected void uninstallListeners()
          if (mouseListener != null)
               tabScroller.tabPanel.removeMouseListener(mouseListener);
               mouseListener = null;
          if (motionListener != null)
               tabScroller.tabPanel.removeMouseMotionListener(motionListener);
               motionListener = null;
          if (focusListener != null)
               tabPane.removeFocusListener(focusListener);
               focusListener = null;
          // PENDING(api): See comment for ContainerHandler
          if (containerListener != null)
               tabPane.removeContainerListener(containerListener);
               containerListener = null;
               if (htmlViews != null)
                    htmlViews.removeAllElements();
                    htmlViews = null;
          if (tabChangeListener != null)
               tabPane.removeChangeListener(tabChangeListener);
               tabChangeListener = null;
          if (propertyChangeListener != null)
               tabPane.removePropertyChangeListener(propertyChangeListener);
               propertyChangeListener = null;
     protected ChangeListener createChangeListener()
          return new TabSelectionHandler();
     protected void installKeyboardActions()
          InputMap km = getMyInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
          SwingUtilities.replaceUIInputMap(tabPane,
                    JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, km);
          km = getMyInputMap(JComponent.WHEN_FOCUSED);
          SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, km);
          ActionMap am = createMyActionMap();
          SwingUtilities.replaceUIActionMap(tabPane, am);
          tabScroller.scrollForwardButton.setAction(am
                    .get("scrollTabsForwardAction"));
          tabScroller.scrollBackwardButton.setAction(am
                    .get("scrollTabsBackwardAction"));
     InputMap getMyInputMap(int condition)
          if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
               return (InputMap) UIManager.get("TabbedPane.ancestorInputMap");
          } else if (condition == JComponent.WHEN_FOCUSED)
               return (InputMap) UIManager.get("TabbedPane.focusInputMap");
          return null;
     ActionMap createMyActionMap()
          ActionMap map = new ActionMapUIResource();
          map.put("navigateNext", new NextAction());
          map.put("navigatePrevious", new PreviousAction());
          map.put("navigateRight", new RightAction());
          map.put("navigateLeft", new LeftAction());
          map.put("navigateUp", new UpAction());
          map.put("navigateDown", new DownAction());
          map.put("navigatePageUp", new PageUpAction());
          map.put("navigatePageDown", new PageDownAction());
          map.put("requestFocus", new RequestFocusAction());
          map.put("requestFocusForVisibleComponent",
                    new RequestFocusForVisibleAction());
          map.put("setSelectedIndex", new SetSelectedIndexAction());
          map.put("scrollTabsForwardAction", new ScrollTabsForwardAction());
          map.put("scrollTabsBackwardAction", new ScrollTabsBackwardAction());
          return map;
     protected void uninstallKeyboardActions()
          SwingUtilities.replaceUIActionMap(tabPane, null);
          SwingUtilities.replaceUIInputMap(tabPane,
                    JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
          SwingUtilities
                    .replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null);
      * Reloads the mnemonics. This should be invoked when a memonic changes,
      * when the title of a mnemonic changes, or when tabs are added/removed.
     private void updateMnemonics()
          resetMnemonics();
          for (int counter = tabPane.getTabCount() - 1; counter >= 0; counter--)
               int mnemonic = tabPane.getMnemonicAt(counter);
               if (mnemonic > 0)
                    addMnemonic(counter, mnemonic);
      * Resets the mnemonics bindings to an empty state.
     private void resetMnemonics()
          if (mnemonicToIndexMap != null)
               mnemonicToIndexMap.clear();
               mnemonicInputMap.clear();
      * Adds the specified mnemonic at the specified index.
     private void addMnemonic(int index, int mnemonic)
          if (mnemonicToIndexMap == null)
               initMnemonics();
          mnemonicInputMap.put(KeyStroke.getKeyStroke(mnemonic, Event.ALT_MASK),
                    "setSelectedIndex");
          mnemonicToIndexMap.put(new Integer(mnemonic), new Integer(index));
      * Installs the state needed for mnemonics.
     private void initMnemonics()
          mnemonicToIndexMap = new Hashtable();
          mnemonicInputMap = new InputMapUIResource();
          mnemonicInputMap.setParent(SwingUtilities.getUIInputMap(tabPane,
                    JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT));
          SwingUtilities
                    .replaceUIInputMap(tabPane,
                              JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
                              mnemonicInputMap);
     // UI Rendering
     public void paint(Graphics g, JComponent c)
          int tc = tabPane.getTabCount();
          if (tabCount != tc)
               tabCount = tc;
               updateMnemonics();
          int selectedIndex = tabPane.getSelectedIndex();
          int tabPlacement = tabPane.getTabPlacement();
          ensureCurrentLayout();
          // Paint content border
          paintContentBorder(g, tabPlacement, selectedIndex);
     protected void paintTab(Graphics g, int tabPlacement, Rectangle[] rects,
               int tabIndex, Rectangle iconRect, Rectangle textRect)
          Rectangle tabRect = rects[tabIndex];
          int selectedIndex = tabPane.getSelectedIndex();
          boolean isSelected = selectedIndex == tabIndex;
          boolean isOver = overTabIndex == tabIndex;
          Graphics2D g2 = null;
          Shape save = null;
          boolean cropShape = false;
          int cropx = 0;
          int cropy = 0;
          if (g instanceof Graphics2D)
               g2 = (Graphics2D) g;
               // Render visual for cropped tab edge...
               Rectangle viewRect = tabScroller.viewport.getViewRect();
               int cropline;
               cropline = viewRect.x + viewRect.width;
               if ((tabRect.x < cropline)
                         && (tabRect.x + tabRect.width > cropline))
                    cropx = cropline - 1;
                    cropy = tabRect.y;
                    cropShape = true;
               if (cropShape)
                    save = g2.getClip();
                    g2
                              .clipRect(tabRect.x, tabRect.y, tabRect.width,
                                        tabRect.height);
          paintTabBackground(g, tabPlacement, tabIndex, tabRect.x, tabRect.y,
                    tabRect.width, tabRect.height, isSelected);
          paintTabBorder(g, tabPlacement, tabIndex, tabRect.x, tabRect.y,
                    tabRect.width, tabRect.height, isSelected);
          String title = tabPane.getTitleAt(tabIndex);
          Font font = tabPane.getFont();
          FontMetrics metrics = g.getFontMetrics(font);
          Icon icon = getIconForTab(tabIndex);
          layoutLabel(tabPlacement, metrics, tabIndex, title, icon, tabRect,
                    iconRect, textRect, isSelected);
          paintText(g, tabPlacement, font, metrics, tabIndex, title, textRect,
                    isSelected);
          paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected);
          paintFocusIndicator(g, tabPlacement, rects, tabIndex, iconRect,
                    textRect, isSelected);
          if (cropShape)
               paintCroppedTabEdge(g, tabPlacement, tabIndex, isSelected, cropx,
                         cropy);
               g2.setClip(save);
          } else if (isOver || isSelected)
               int dx = tabRect.x + tabRect.width - BUTTONSIZE - WIDTHDELTA;
               int dy = (tabRect.y + tabRect.height) / 2 - 6;
               if (isCloseButtonEnabled)
                    paintCloseIcon(g2, dx, dy, isOver);
     protected void paintCloseIcon(Graphics g, int dx, int dy, boolean isOver)
          paintActionButton(g, dx, dy, closeIndexStatus, isOver, closeB,
                    closeImgB);
          g.drawImage(closeImgI, dx, dy + 1, null);
     protected void paintActionButton(Graphics g, int dx, int dy, int status,
               boolean isOver, JButton button, BufferedImage image)
          button.setBorder(null);
          if (isOver)
               switch (status)
               case OVER:
                    button.setBorder(OVERBORDER);
                    break;
               case PRESSED:
                    button.setBorder(PRESSEDBORDER);
                    break;
          button.setBackground(tabScroller.tabPanel.getBackground());
          button.paint(image.getGraphics());
          g.drawImage(image, dx, dy, null);
      * This method will create and return a polygon shape for the given tab
      * rectangle which has been cropped at the specified cropline with a torn
      * edge visual. e.g. A "File" tab which has cropped been cropped just after
      * the "i": ------------- | ..... | | . | | ... . | | . . | | . . | | . . |
      * The x, y arrays below define the pattern used to create a "torn" edge
      * segment which is repeated to fill the edge of the tab. For tabs placed on
      * TOP and BOTTOM, this righthand torn edge is created by line segments
      * which are defined by coordinates obtained by subtracting xCropLen[i] from
      * (tab.x + tab.width) and adding yCroplen[i] to (tab.y). For tabs placed on
      * LEFT or RIGHT, the bottom torn edge is created by subtracting xCropLen[i]
      * from (tab.y + tab.height) and adding yCropLen[i] to (tab.x).
     private static final int     CROP_SEGMENT     = 12;
     private void paintCroppedTabEdge(Graphics g, int tabPlacement,
               int tabIndex, boolean isSelected, int x, int y)
          g.setColor(shadow);
          g.drawLine(x, y, x, y + rects[tabIndex].height);
     private void ensureCurrentLayout()
          if (!tabPane.isValid())
               tabPane.validate();
           * If tabPane doesn't have a peer yet, the validate() call will silently
           * fail. We handle that by forcing a layout if tabPane is still invalid.
           * See bug 4237677.
          if (!tabPane.isValid())
               TabbedPaneLayout layout = (TabbedPaneLayout) tabPane.getLayout();
               layout.calculateLayoutInfo();
      * Returns the bounds of the specified tab in the coordinate space of the
      * JTabbedPane component. This is required because the tab rects are by
      * default defined in the coordinate space of the component where they are
      * rendered, which could be the JTabbedPane (for WRAP_TAB_LAYOUT) or a
      * ScrollableTabPanel (SCROLL_TAB_LAYOUT). This method should be used
      * whenever the tab rectangle must be relative to the JTabbedPane itself and
      * the result should be placed in a designated Rectangle object (rather than
      * instantiating and returning a new Rectangle each time). The tab index
      * parameter must be a valid tabbed pane tab index (0 to tab count - 1,
      * inclusive). The destination rectangle parameter must be a valid
      * <code>Rectangle</code> instance. The handling of invalid parameters is
      * unspecified.
      * @param tabIndex
      *            the index of the tab
      * @param dest
      *            the rectangle where the result should be placed
      * @return the resulting rectangle
      * @since 1.4
     protected Rectangle getTabBounds(int tabIndex, Rectangle dest)
          try{
               dest.width = rects[tabIndex].width;
               dest.height = rects[tabIndex].height;
               Point vpp = tabScroller.viewport.getLocation();
               Point viewp = tabScroller.viewport.getViewPosition();
               dest.x = rects[tabIndex].x + vpp.x - viewp.x;
               dest.y = rects[tabIndex].y + vpp.y - viewp.y;
          }catch(Throwable a_th){}
          return dest;
     private int getTabAtLocation(int x, int y)
          ensureCurrentLayout();
          int tabCount = tabPane.getTabCount();
          for (int i = 0; i < tabCount; i++)
               if (rects.contains(x, y))
                    return i;
          return -1;
     public int getOverTabIndex()
          return overTabIndex;
     * Returns the index of the tab closest to the passed in location, note that
     * the returned tab may not contain the location x,y.
     private int getClosestTab(int x, int y)
          int min = 0;
          int tabCount = Math.min(rects.length, tabPane.getTabCount());
          int max = tabCount;
          int tabPlacement = tabPane.getTabPlacement();
          boolean useX = (tabPlacement == TOP || tabPlacement == BOTTOM);
          int want = (useX) ? x : y;
          while (min != max)
               int current = (max + min) / 2;
               int minLoc;
               int maxLoc;
               if (useX)
                    minLoc = rects[current].x;
                    maxLoc = minLoc + rects[current].width;
               } else
                    minLoc = rects[current].y;
                    maxLoc = minLoc + rects[current].height;
               if (want < minLoc)
                    max = current;
                    if (min == max)
                         return Math.max(0, current - 1);
               } else if (want >= maxLoc)
                    min = current;
                    if (max - min <= 1)
                         return Math.max(current + 1, tabCount - 1);
               } else
                    return current;
          return min;
     * Returns a point which is translated from the specified point in the
     * JTabbedPane's coordinate space to the coordinate space of the
     * ScrollableTabPanel. This is used for SCROLL_TAB_LAYOUT ONLY.
     private Point translatePointToTabPanel(int srcx, int srcy, Point dest)
          Point vpp = tabScroller.viewport.getLocation();
          Point viewp = tabScroller.viewport.getViewPosition();
          dest.x = srcx + vpp.x + viewp.x;
          dest.y = srcy + vpp.y + viewp.y;
          return dest;
     // BasicTabbedPaneUI methods
     // Tab Navigation methods
     // REMIND(ADC,7/29/98): This method should be made
     // protected in the next release where
     // API changes are allowed
     boolean requestMyFocusForVisibleComponent()
          Component visibleComponent = getVisibleComponent();
          if (visibleComponent.isFocusTraversable())
               visibleComponent.requestFocus();
               return true;
          } else if (visibleComponent instanceof JComponent)
               if (((JComponent) visibleComponent).requestDefaultFocus())
                    return true;
          return false;
     private static class RightAction extends AbstractAction
          public void actionPerformed(ActionEvent e)
               JTabbedPane pane = (JTabbedPane) e.getSource();
               VCTabPaneUI ui = (VCTabPaneUI) pane.getUI();
               ui.navigateSelectedTab(EAST);
     private static class LeftAction extends AbstractAction
          public void actionPerformed(ActionEvent e)
               JTabbedPane pane = (JTabbedPane) e.getSource();
               VCTabPaneUI ui = (VCTabPaneUI) pane.getUI();
               ui.navigateSelectedTab(WEST);
     private static class UpAction extends AbstractAction
          public void actionPerformed(ActionEvent e)
               JTabbedPane pane = (JTabbedPane) e.getSource();
               VCTabPaneUI ui = (VCTabPaneUI) pane.getUI();
               ui.navigateSelectedTab(NORTH);
     private static class DownAction extends AbstractAction
          public void actionPerformed(ActionEvent e)
               JTabbedPane pane = (JTabbedPane) e.getSource();
               VCTabPaneUI ui = (VCTabPaneUI) pane.getUI();
               ui.navigateSelectedTab(SOUTH);
     private static class NextAction extends AbstractAction
          public void actionPerformed(ActionEvent e)
               JTabbedPane pane = (JTabbedPane) e.getSource();
               VCTabPaneUI ui = (VCTabPaneUI) pane.getUI();
               ui.navigateSelectedTab(NEXT);
     private static class PreviousAction extends AbstractAction
          public void actionPerformed(ActionEvent e)
               JTabbedPane pane = (JTabbedPane) e.getSource();
               VCTabPaneUI ui = (VCTabPaneUI) pane.getUI();
               ui.navigateSelectedTab(PREVIOUS);
     private static class PageUpAction extends AbstractAction
          public void actionPerformed(ActionEvent e)
               JTabbedPane pane = (JTabbedPane) e.getSource();
               VCTabPaneUI ui = (VCTabPaneUI) pane.getUI();
               int tabPlacement = pane.getTabPlacement();
               if (tabPlacement == TOP || tabPlacement == BOTTOM)
                    ui.navigateSelectedTab(WEST);
               } else
                    ui.navigateSelectedTab(NORTH);
     private static class PageDownAction extends AbstractAction
          public void actionPerformed(ActionEvent e)
               JTabbedPane pane = (JTabbedPane) e.getSource();
               VCTabPaneUI ui = (VCTabPaneUI) pane.getUI();
               int tabPlacement = pane.getTabPlacement();
               if (tabPlacement == TOP || tabPlacement == BOTTOM)
                    ui.navigateSelectedTab(EAST);
               } else
                    ui.navigateSelectedTab(SOUTH);
     private static class RequestFocusAction extends AbstractAction
          public void actionPerformed(ActionEvent e)
               JTabbedPane pane = (JTabbedPane) e.getSource();
               pane.requestFocus();
     private static class RequestFocusForVisibleAction extends AbstractAction
          public void actionPerformed(ActionEvent e)
               JTabbedPane pane = (JTabbedPane) e.getSource();
               VCTabPaneUI ui = (VCTabPaneUI) pane.getUI();
               ui.requestMyFocusForVisibleComponent();
     * Selects a tab in the JTabbedPane based on the String of the action
     * command. The tab selected is based on the first tab that has a mnemonic
     * matching the first character of the action command.
     private static class SetSelectedIndexAction extends AbstractAction
          public void actionPerformed(ActionEvent e)
               JTabbedPane pane = (JTabbedPane) e.getSource();
               if (pane != null && (pane.getUI() instanceof VCTabPaneUI))
                    VCTabPaneUI ui = (VCTabPaneUI) pane.getUI();
                    String command = e.getActionCommand();
                    if (command != null && command.length() > 0)
                         int mnemonic = (int) e.getActionCommand().charAt(0);
                         if (mnemonic >= 'a' && mnemonic <= 'z')
                              mnemonic -= ('a' - 'A');
                         Integer index = (Integer) ui.mnemonicToIndexMap
                                   .get(new Integer(mnemonic));
                         if (index != null && pane.isEnabledAt(index.intValue()))
                              pane.setSelectedIndex(index.intValue());
     private static class ScrollTabsForwardAction extends AbstractAction
          public void actionPerformed(ActionEvent e)
               JTabbedPane pane = null;
               Object src = e.getSource();
               if (src instanceof JTabbedPane)
                    pane = (JTabbedPane) src;
               } else if (src instanceof ScrollableTabButton)
                    pane = (JTabbedPane) ((ScrollableTabButton) src).getParent();
               } else
                    return; // shouldn't happen
               VCTabPaneUI ui = (VCTabPaneUI) pane.getUI();
               ui.tabScroller.scrollForward(pane.getTabPlacement());
     private static class ScrollTabsBackwardAction extends AbstractAction
          public void actionPerformed(ActionEvent e)
               JTabbedPane pane = null;
               Object src = e.getSource();
               if (src instanceof JTabbedPane)
                    pane = (JTabbedPane) src;
               } else if (src instanceof ScrollableTabButton)
                    pane = (JTabbedPane) ((ScrollableTabButton) src).getParent();
               } else
                    return; // shouldn't happen
               VCTabPaneUI ui = (VCTabPaneUI) pane.getUI();
               ui.tabScroller.scrollBackward(pane.getTabPlacement());
     * This inner class is marked "public" due to a compiler bug. This
     * class should be treated as a "protected" inner class.
     * Instantiate it only within subclasses of BasicTabbedPaneUI.
     private class TabbedPaneScrollLayout extends TabbedPaneLayout
          protected int preferredTabAreaHeight(int tabPlacement, int width)
               return calculateMaxTabHeight(tabPlacement);
          protected int preferredTabAreaWidth(int tabPlacement, int height)
               return calculateMaxTabWidth(tabPlacement);
          public void layoutContainer(Container parent)
               int tabPlacement = tabPane.getTabPlacement();
               int tabCount = tabPane.getTabCount();
               Insets insets = tabPane.getInsets();
               int selectedIndex = tabPane.getSelectedIndex();
               Component visibleComponent = getVisibleComponent();
               calculateLayoutInfo();
               if (selectedIndex < 0)
                    if (visibleComponent != null)
                         // The last tab was removed, so remove the component
                         setVisibleComponent(null);
               } else
                    Component selectedComponent = tabPane
                              .getComponentAt(selectedIndex);
                    boolean shouldChangeFocus = false;
                    // In order to allow programs to use a single component
                    // as the display for multiple tabs, we will not change
                    // the visible compnent if the currently selected tab
                    // has a null component. This is a bit dicey, as we don't
                    // explicitly state we support this in the spec, but since
                    // programs are now depending on this, we're making it work.
                    if (selectedComponent != null)
                         if (selectedComponent != visibleComponent
                                   && visibleComponent != null)
                              if (SwingUtilities.findFocusOwner(visibleComponent) != null)
                                   shouldChangeFocus = true;
                         setVisibleComponent(selectedComponent);
                    int tx, ty, tw, th; // tab area bounds
                    int cx, cy, cw, ch; // content area bounds
                    Insets contentInsets = getContentBorderInsets(tabPlacement);
                    Rectangle bounds = tabPane.getBounds();
                    int numChildren = tabPane.getComponentCount();
                    if (numChildren > 0)
                         // calculate tab area bounds
                         tw = bounds.width - insets.left - insets.right;
                         th = calculateTabAreaHeight(tabPlacement, runCount,
                                   maxTabHeight);
                         tx = insets.left;
                         ty =

Similar Messages

  • How to add a Button in JFrame title Bar ?

    Hi Folks,
    I want to add a button near to JFrame's Minimize Button(On the title bar). How can i do it ? Should i extend RootPaneUI and add custom button ? Any other easy ways to do this ?
    If anyone provides me Sample Code how to do it, It is much Appreciated.
    Thanks,

    There's no easy way to achieve this. You'll have to provide a RootPaneUI delegate with a custom title pane implementation. There, you'll have to provide a custom layout to position your button. In addition, this approach will not work on look-and-feels that do not support decorated mode (such as Windows or GTK) since under such LAFs the title pane always comes from the OS.

  • Add a Button in JFrame Title Bar

    How can I add a button in JFrame Title Bar. I want to put on more button for docking after the closing button in the title bar.

    if you use JFrame.setDefaultLookAndFeelDecorated(true) then you can do it by extending the JRootPaneUI class of the L&F (the default is the metal L&F). that is not a easy task but if you want take a look at BasicRootPaneUI, there you will have to point it to a new TitlePane which you will have to create. to load all this you must use the UIManager class. if you need more explaination try reading on look and feel and customizing it.

  • JTabbedPane Title change

    I have a JTabbedPane with different component like txtName, cbCourse. If i edit the name of the txtName field, the corresponding name should change in the JTabbedPane title also. As of now i can update the txtName value after saving in the DB. But i want to update the txtName value in to JTabbedPane title while i edit in the txtName component. ( "txtName" is the JTextField component).

    remove the panel and set the tab with new tabname ,
    that will work .
    -MMaybe, but RTFM will yield the following, much more appropriate method:
    public void setTitleAt( int index, String title )...

  • User-defined F4 Search - cancel button in the title bar

    Hi,
    I implement user-defined F4 search for my WD application. F4 view comes from another component (as described in the tutorial). Everything is fine, I see that view popuped when F4 is clicked for an input field. My problem is, how to make visible the Close button in the title bar of that popup window.
    I was able to set window's title text, but have no idea how to control those buttons. I only see maximize button which comes by default.
    Also would be nice to create kind of standard OK and Cancel buttons on the bottom bar instead of creating them manually on my view... I've tried set_button_kind(), it works somehow: displayes three empty buttons without icons - need more info about it too...
    Thanks

    Hi Serguei,
    The empty buttons are worth a ticket.
    The behavior for the close button in popups is that the application developer can determine its visibility independent from the buttons in the lower row.
    The second aspect is the action that is triggered if someone clicks that button. There the application developer is able to bind a separate action to that close button. If no action was bound and if a cancel button is visible, clicking the close button will trigger the same action as it would have been the case for the cancel button. A bit complicated, I know. We had to do the latter for backwards compatibility.
    Best regards,
    Thomas

  • Creating the highlighted button version of title screen

    I am using Motion to create the title screen of my DVD.
    There are going to be 2 buttons on the title screen, which will go to two different tracks.
    What I would like to do is have the buttons (text) appear a faded blue when not selected, and then bright yellow when selected.
    This must be REALLY simple to do, but I'm pretty new and inexperienced at DVD Studio Pro.
    What direction should I go in?

    Create overlays and set the colors
    http://dvdstepbystep.com/newmap.php

  • TEMPLATE Button Region without Title

    I am trying to complete the “How to Build and Deploy an Issue Tracking Application” from the “2Day Developer” document.
    On page 10-29 I am told to select the Template “Button Region without Title” template.
    I only see five templates …. (%, No Template, and three “Maroon templates). I used the utility to load CSSs into the repository but don’t recall seeing anything about loading templates.
    Where are the templates after one initially installs HTTMLDB ? Are they in the “\htmldb\images\templates” folder and do they need to be imported from there?
    Speaking of the repository --- where does it actually reside and who owns it?
    If there is a document out there that has answers to all those questions I’ll refer to that if anyone has a link.
    Thanks; (Hope I can find that “button Region without Title” template so I can resume the tutorial)
    Sign me … Dazed and Confused : )

    Turns out the customer was experiencing periodic problems with "classic" web toolkit issues, i.e. broken pages with "&lt;htm" appearing etc.
    However, after bringing forward their plans to apply the patch - now at 10.1.2.0.6 - and checking the DAD character set is AL32UTF8, this issue persists. As well as afflicting the template mentioned above, it is now also intermittently affecting a more complex Named Column report template (depending on whether columns are included in the report or not).
    For the button region template, this is happening consistently wherever it appears (it's used on a multi-page wizard), and the first 5 characters of the template are always stripped, whatever they are - valid markup, whitespace, gibberish...

  • How to make JTabbedPane Title component take up entire tab width?

    Starting with JDK 1.6, JTabbedPane has been enhanced to allow you to specify an arbitrary Component for the title of a tab (I think before, you could only specify a JLabel and/or icon). We make use of this in our application by specifying a Panel with a GridBagLayout and three children: an Icon (on the left), a label (middle), and a close button (right). the middle component, the label, gets all the weightx and has fill set to HORIZONTAL. Everything looks good - as long as the tabs stay on a single row. When another tab is added and the TabbedPane extends to a second row, things don't look: the tabs are allocated alot more white space now - but the Component isn't being given that extra space! Consequently, the icons on the left and right of my label stay next to the label, instead of staying next to the edges of the tab!
    Is this a bug in the JDK?
    If it's not a bug, how do I make use of all available tab space?

    Hi Darryl,
    Thanks for the suggestion. Below is a primitive standalone example. It brings up an empty frame and you can click on the "Add Tab" button to add a tab. When you do, you'll see that the tab's "title" area consists of an "i" button, a label, and a "x" button. The tab itself isn't much bigger than those three components, so things look ok. Now, add two more tabs....the 2nd tab still fits on the first row of the TabbedPane, so things still look ok. When you add the third tab, the first tab gets placed on a new 2nd row of the TabbedPane and the tab takes up the whole width of the TabbedPane....but the "i" and the "x" buttons are still scrunched up next to the label - rather than near the edges of the tab, where they would be expected.
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    public class TabExample extends javax.swing.JFrame {
        public TabExample() {
            initComponents();
         class TabRenderer extends JPanel {
              private JButton infoButton;
              private JLabel label;
              private JButton closeButton;
              public TabRenderer(String title) {
                   infoButton = new JButton("i");
                   label = new JLabel(title);
                   closeButton = new JButton("x");
                   setLayout(new GridBagLayout());
                   GridBagConstraints gc = new GridBagConstraints();
                   gc.gridy = 0;
                   gc.gridx = 0;
                   gc.anchor = GridBagConstraints.WEST;
                   gc.fill = GridBagConstraints.NONE;
                   gc.weightx = 0;
                   this.add(infoButton, gc);
                   gc.gridx = 1;
                   gc.anchor = GridBagConstraints.WEST;
                   gc.fill = GridBagConstraints.HORIZONTAL;
                   gc.weightx = 1.0;
                   this.add(label, gc);
                   gc.gridx = 2;
                   gc.anchor = GridBagConstraints.EAST;
                   gc.fill = GridBagConstraints.NONE;
                   gc.weightx = 0;
                   this.add(closeButton, gc);
        private void initComponents() {
            tabbedPane = new javax.swing.JTabbedPane();
            jButton1 = new javax.swing.JButton();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            getContentPane().add(tabbedPane, java.awt.BorderLayout.CENTER);
            jButton1.setText("Add Tab");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    addTabHandler(evt);
            getContentPane().add(jButton1, java.awt.BorderLayout.SOUTH);
            pack();
         private void addTabHandler(java.awt.event.ActionEvent evt) {
              int index = tabbedPane.getTabCount();
              tabbedPane.add(new JPanel(), index);
              tabbedPane.setTabComponentAt(index, new TabRenderer("Tab " + index));
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    JFrame f = new TabExample();
                        f.setSize(400, 300);
                        f.setVisible(true);
        private javax.swing.JButton jButton1;
        private javax.swing.JTabbedPane tabbedPane;
    }

  • Add button to JTabbedPane to add new tab

    Does anyone know how to add a JButton to a JTabbed pane (in the tab bar) so that it is always at the end of all the tabs and when it is clicked it will add a new tab into the tabbed pane.
    The functionallity I am looking for is the same as that provided by the button in the tab bar for Firefox and Internet Explorer.

    Along the line of what TBM was saying:
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    class NewTabDemo implements Runnable
      JTabbedPane tabs;
      ChangeListener listener;
      int numTabs;
      public static void main(String[] args)
        SwingUtilities.invokeLater(new NewTabDemo());
      public void run()
        listener = new ChangeListener()
          public void stateChanged(ChangeEvent e)
            addNewTab();
        tabs = new JTabbedPane();
        tabs.add(new JPanel(), "Tab " + String.valueOf(numTabs), numTabs++);
        tabs.add(new JPanel(), "+", numTabs++);
        tabs.addChangeListener(listener);
        JFrame frame = new JFrame(this.getClass().getName());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(tabs, BorderLayout.CENTER);
        frame.pack();
        frame.setSize(new Dimension(400,200));
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      private void addNewTab()
        int index = numTabs-1;
        if (tabs.getSelectedIndex() == index)
          tabs.add(new JPanel(), "Tab " + String.valueOf(index), index);
          tabs.removeChangeListener(listener);
          tabs.setSelectedIndex(index);
          tabs.addChangeListener(listener);
          numTabs++;
    }

  • Add tool tip to left right button in JTabbedPane??

    Hi,
    I am using a tabbed pane with follwong setting.
    tabPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
    So when the no of tab is more a left right button appears.
    I want to add tool tip to these button
    How do i get the instance of these buttons
    thnx
    Neel

    try this for east/west, similar for north/south
    (hopefully there's an easier way)
    import java.awt.*;
    import javax.swing.*;
    class Testing extends JFrame
      public Testing()
        setLocation(300,200);
        setSize(150,100);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JTabbedPane tp = new JTabbedPane();
        tp.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
        tp.setUI(new MyUI());
        for(int x = 0; x < 12; x++)
          JPanel p = new JPanel();
          p.add(new JLabel(""+x));
          tp.addTab(""+(char)(x+65),p);
        getContentPane().add(tp);
      class MyUI extends javax.swing.plaf.metal.MetalTabbedPaneUI
        protected JButton createScrollButton(int direction)
          if (direction != SOUTH && direction != NORTH && direction != EAST && direction != WEST)
              throw new IllegalArgumentException("Direction must be one of: SOUTH, NORTH, EAST or WEST");
          return new ScrollableTabButton(direction);
        private class ScrollableTabButton extends javax.swing.plaf.basic.BasicArrowButton implements javax.swing.plaf.UIResource,SwingConstants
          public ScrollableTabButton(int direction)
            super(direction, UIManager.getColor("TabbedPane.selected"),
                             UIManager.getColor("TabbedPane.shadow"),
                             UIManager.getColor("TabbedPane.darkShadow"),
                             UIManager.getColor("TabbedPane.highlight"));
            if(direction == WEST) setToolTipText("<<<<<");
            else if(direction == EAST) setToolTipText(">>>>>");
      public static void main(String[] args){new Testing().setVisible(true);}
    }

  • Bold in JTabbedPane title overlapping tab edge

    I extended the BasicTabbedPaneUI and implemented paintText() to use a bold font if the tab is selected. This works OK, unless the tab has a long title in which case the bold text overlaps the edge of the tab. I tried using a smaller font size, but it still didn't work in some cases.
    How do I change the size of the tab?
    Here's my implementation:
    -------------------------MyTabbedPane.java-----------------------
    <pre>
    import javax.swing.plaf.basic.BasicTabbedPaneUI;
    import java.awt.*;
    public class MyTabbedPaneUI extends BasicTabbedPaneUI {
         private Font boldFont = null;
         public MyTabbedPaneUI(Font font)
              this.boldFont = new Font(font.getFontName(), Font.BOLD, font.getSize());
         protected void paintText(Graphics g,
                                  int tabPlacement,
                                  Font font,
                                  FontMetrics metrics,
                                  int tabIndex,
                                  String title,
                                  Rectangle textRect,
                                  boolean isSelected)
              if(isSelected)
                   super.paintText(g, tabPlacement, boldFont, metrics, tabIndex, title, textRect, isSelected);
              else
                   super.paintText(g, tabPlacement, font, metrics, tabIndex, title, textRect, isSelected);
    </pre>
    ------Here's how it's used-----------
    JTabbedPane tabbedPaneTop = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.WRAP_TAB_LAYOUT);
    // set-up tab UI
    MyTabbedPaneUI tabUI = new MyTabbedPaneUI(tabbedPaneTop.getFont());
    tabbedPaneTop.setUI(tabUI);

    I figured out how to fix my problem. Had to override a couple more methods. See my code below.
    import javax.swing.plaf.basic.BasicTabbedPaneUI;
    import java.awt.*;
    import javax.swing.*;
    public class MyTabbedPaneUI extends BasicTabbedPaneUI {
         private Font boldFont = null;
         private FontMetrics boldFM = null;
         public MyTabbedPaneUI(Font font)
              this.boldFont = new Font(font.getFontName(), Font.BOLD, font.getSize());
         public void installUI(JComponent c)
              super.installUI(c);
              this.boldFM = c.getFontMetrics(this.boldFont);
         protected void paintText(Graphics g,
                       int tabPlacement,
                       Font font,
                       FontMetrics metrics,
                       int tabIndex,
                       String title,
                                  Rectangle textRect,
                       boolean isSelected)
              if(isSelected)
                   Rectangle rect = this.getTabBounds(this.tabPane, tabIndex);
                   int centerX = rect.x + rect.width/2;
                   int centerY = rect.y + rect.height/2;
                   int textH = this.boldFM.getHeight();
                   int textW = this.boldFM.stringWidth(this.tabPane.getTitleAt(tabIndex));
                   rect.x = centerX - textW/2;
                   rect.y = centerY - textH/2;
                   rect.width = textW;
                   rect.height = textH;
                   super.paintText(g, tabPlacement, boldFont, this.boldFM, tabIndex, title, rect, isSelected);
              else
                   super.paintText(g, tabPlacement, font, metrics, tabIndex, title, textRect, isSelected);
         protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics)
              if (this.tabPane.getSelectedIndex() == tabIndex)
                   return super.calculateTabWidth(tabPlacement, tabIndex, this.boldFM);
              else
                   return super.calculateTabWidth(tabPlacement, tabIndex, metrics);
    }

  • Button into the title of a JFrame

    How can I put Buttons or Icons (which can handle the mouse click) into the title bar of a JFrame? Is it possible anyway?
    Fast reply will be pleased.
    Bye Zafir

    I used a JWindow and created my title bar, add a mouseListener as sort of a secert code to get out of the app.
    private JLabel setBanner(){
        banner = new JLabel();
        banner.setBackground( Color.blue );
        banner.setBounds(0,0,screenW, 15 );
        banner.addMouseListener (new java.awt.event.MouseAdapter () {
            public void mouseReleased (java.awt.event.MouseEvent evt) {
              // do your work or whatever in here
         return banner;
       // add the banner
       mainPanel.add(setBanner());Of course you lose the icon and min max close

  • Button in JTabbedPane tab

    Greetings,
    i'd like to have a button on every tab in JTabbedPane, like close button in NetBeans when you edit the code. By default, you can put an icon only. Do you guys know how to do that?
    thanks in advence.

    If you can wait another couple of months (or if you are willing to use the beta version), you can use the new JTabbedPane features in Java 6 (Mustang). Have a look at the method setTabComponentAt:
    [url http://download.java.net/jdk6/docs/api/javax/swing/JTabbedPane.html#setTabComponentAt(int,%20java.awt.Component)]setTabComponentAt

  • Icon and a button in JTabbedPane Tabs

    Hi,
    i want to put an icon on the left side of the text and a button on the right side(Same as the eclipse tabs). Can any one help me how to do this.
    thnx in advance.

    Search the forum using "jtabbedpane close icon" for other discussions on this topic.

  • Add Help Button to JDialog title pane

    I would like to add a help button just before the close button on my JDialog title pane. I have a working solution (rewriting the title pane code for JInternalFrame), but I'd like to get access to the real JDialog title pane code and just extend that, so I don't have a lot of maintenance on the code.
    As best as I can tell, the JDialog title pane code is natively written. I'm hoping that this is not the case and I'm just not finding the right class.
    Any help is greatly appreciated

    I think this is a windows toolkit thing and can't be dochanged in java/ Could be wrong tho

Maybe you are looking for

  • Iphone 5s restore issues

    I have recently converted to an iphone 5s 16GB from an iphone 4s 32GB. I backed up my 4s to itunes but when I try and restore my 5s with all my 4s data is says there's not enough storage. I purchased an extra 20GB on icloud thinking that it might all

  • HDMI to VGA??

    Hi All, I'bve just bought a new Mac Mini for work, I am trying to run a VGA monitor from the HDMI port using a startech HDMI2VGA Convertor but to no avail.......has anyone had any experience using one of these, or can point me where/why I might be go

  • Response Message Namespace Resolution

    I'm working on an application that creates xml messages from wsdls and then sends them out and picks up the response (like a basic web service). I've encountered a problem with the resoultion of namespaces on the parts of the response message of an o

  • Parent of Top node is getting added as Orphan node

    Hi , When I am trying to import the below test import file in DRM 11.1.2 - [hier] Product|P000000 [node] P000000 [relation] P000000|None|Total Product|True the parent of top node P000000 which is 'None' as defined in System preferences , is getting a

  • Windows updating on a mac

    I already owned a Windows XP service pack one, so I used it on my computer. I partitioned my hard drive and it works fine, except I need the service pack two in order for my airport card to deliver internet to the Windows side of my computer. I downl