Here you can find the source of removeComponentFromPanel(Component removeComponent, JPanel fromPanel)
Parameter | Description |
---|---|
removeComponent | the component to be removed |
fromPanel | from what panel |
static public void removeComponentFromPanel(Component removeComponent, JPanel fromPanel)
//package com.java2s; //License from project: Apache License import javax.swing.*; import java.awt.*; public class Main { /**/*from w w w . j av a 2s . c om*/ * removePanelFromPanel removes a specific Component from another panel * * @param removeComponent the component to be removed * @param fromPanel from what panel */ static public void removeComponentFromPanel(Component removeComponent, JPanel fromPanel) { fromPanel.remove(removeComponent); fromPanel.revalidate(); fromPanel.repaint(); } }