/[classpath]/classpath/javax/swing/JTabbedPane.java
ViewVC logotype

Diff of /classpath/javax/swing/JTabbedPane.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by langel, Wed Nov 9 16:52:35 2005 UTC revision 1.24 by langel, Wed Nov 9 21:30:10 2005 UTC
# Line 337  public class JTabbedPane extends JCompon Line 337  public class JTabbedPane extends JCompon
337       */       */
338      public void setComponent(Component c)      public void setComponent(Component c)
339      {      {
340        if (c != null)        component = c;
         {  
           remove(component);  
           add(c);  
           this.component = c;  
         }  
341      }      }
342    
343      /**      /**
# Line 971  public class JTabbedPane extends JCompon Line 966  public class JTabbedPane extends JCompon
966        super.add(component);        super.add(component);
967      else      else
968        insertTab(component.getName(), null, component, null, tabs.size());        insertTab(component.getName(), null, component, null, tabs.size());
969        
970      return component;      return component;
971    }    }
972    
# Line 1054  public class JTabbedPane extends JCompon Line 1050  public class JTabbedPane extends JCompon
1050    }    }
1051    
1052    /**    /**
1053     * The tab and it's associated component are removed. After the component     * Removes the tab at index. After the component associated with
1054     * has been removed from the JTabbedPane, it's set visible to ensure that     * index is removed, its visibility is reset to true to ensure it
1055     * it can be seen.     * will be visible if added to other containers.
1056     *     *
1057     * @param index The index of the tab to remove.     * @param index The index of the tab to remove.
1058     */     */
# Line 1070  public class JTabbedPane extends JCompon Line 1066  public class JTabbedPane extends JCompon
1066    }    }
1067    
1068    /**    /**
1069     * This method removes the component from the JTabbedPane. After the     * Removes the specified Component from the JTabbedPane.
    * component has been removed from the JTabbedPane, it's  set visible to  
    * ensure that it can be seen.  
1070     *     *
1071     * @param component The Component to remove.     * @param component The Component to remove.
1072     */     */
1073    public void remove(Component component)    public void remove(Component component)
1074    {    {
     // This simply removes the component.  
     int index = indexOfComponent(component);  
1075      super.remove(component);      super.remove(component);
     component.show();  
     setComponentAt(index, null);  
1076    }    }
1077    
1078    /**    /**
1079     * This method removes the tab and component from the JTabbedPane. It simply     * Removes the tab and component which corresponds to the specified index.
    * calls removeTabAt(int index).  
1080     *     *
1081     * @param index The index of the tab to remove.     * @param index The index of the tab to remove.
1082     */     */

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26