Container cont = frame.getContentPane(); //取得窗体的容器
cont.add(lab); //在容器中加入组件
等价与
frame.getContentPane().add(lab); //使用了匿名对象,如new Preson("zhangsan", 30).tell();
Container cont = frame.getContentPane(); //取得窗体的容器
cont.add(lab); //在容器中加入组件
等价与
frame.getContentPane().add(lab); //使用了匿名对象,如new Preson("zhangsan", 30).tell();