当前位置: 技术问答>java相关
请问有没有从把panel上的swing component的方法
来源: 互联网 发布时间:2015-11-13
本文导语: 可通过panel.add(component)将一个component加到panel中,请问有没有方法将component从panel中去掉? | remove public void remove(int index)Removes the component, specified by index, from this container. Parameters: index - ...
可通过panel.add(component)将一个component加到panel中,请问有没有方法将component从panel中去掉?
|
remove
public void remove(int index)Removes the component, specified by index, from this container.
Parameters:
index - the index of the component to be removed.
Since:
JDK1.1
See Also:
add(java.awt.Component)
--------------------------------------------------------------------------------
remove
public void remove(Component comp)Removes the specified component from this container.
Parameters:
comp - the component to be removed
See Also:
add(java.awt.Component)
--------------------------------------------------------------------------------
removeAll
public void removeAll()Removes all the components from this container.
See Also:
add(java.awt.Component), remove(int)
public void remove(int index)Removes the component, specified by index, from this container.
Parameters:
index - the index of the component to be removed.
Since:
JDK1.1
See Also:
add(java.awt.Component)
--------------------------------------------------------------------------------
remove
public void remove(Component comp)Removes the specified component from this container.
Parameters:
comp - the component to be removed
See Also:
add(java.awt.Component)
--------------------------------------------------------------------------------
removeAll
public void removeAll()Removes all the components from this container.
See Also:
add(java.awt.Component), remove(int)