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 |
/** |
/** |
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 |
|
|
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 |
*/ |
*/ |
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 |
*/ |
*/ |