因此,我知道您可以通过以下方式将java中的对象添加到其中:topPanel.add(something); 但是,我该如何从topPanel中取出一些东西。基本上意味着以下内容:topPanel.takeAway(winCounter); 有没有办法做到这一点,它的正确语法是什么? 最佳答案 使用remove()方法 topPanel.remove(winCounter);