的一部分,所以我知道,你可以在Java的东西,通过这样的添加对象:带走对象
topPanel.add(something);
不过,我会怎么做这与取出来的东西的topPanel的。东西会基本含义如下:
topPanel.takeAway(winCounter);
有没有办法做到这一点,什么是它的正确语法?
的一部分,所以我知道,你可以在Java的东西,通过这样的添加对象:带走对象
topPanel.add(something);
不过,我会怎么做这与取出来的东西的topPanel的。东西会基本含义如下:
topPanel.takeAway(winCounter);
有没有办法做到这一点,什么是它的正确语法?
的对象必须包含收集和一些添加和删除方法。这里有一个基本的例子:
public class Parent {
List children = new ArrayList();
public void add(Node node) {
items.add(node);
}
public void remove(Node node) {
items.remove(node);
}
}
topPanel.remove(something); ? – 2012-03-26 05:12:29
什么样的类是'topPanel'的一个实例? – aroth 2012-03-26 05:12:57