Does getContentPane().add() mean the same as add()(getContentPane().add() 和 add() 的意思一样吗)
问题描述
getContentPane().add() 和 add() 意思一样吗?
Does getContentPane().add() mean the same as add() ?
public class TestFrame extends JFrame{
public TestFrame() {
JLabel label = new JLabel("jo");
getContentPane().add(label);
add(label);
}
}
推荐答案
getContentPane().add() 和 add() 意思一样吗?
Does getContentPane().add() mean the same as add() ?
是的,从 1.5+ 开始.
Yes, since 1.5+.
这篇关于getContentPane().add() 和 add() 的意思一样吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!