标题:一个小程序,有错,请教
取消只看楼主
Tainform
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2004-9-26
 问题点数:0 回复次数:0 
一个小程序,有错,请教
public class test extends Applet
{
 public void init()
 {
  Container cp=getContentPane();
  cp.setLayout(new FlowLayout());
  JButton B1=new JButton("开始");
  JButton B2=new JButton("停止");
  cp.add(B1);
  cp.add(B2);
 }
}

编译是错误如下:

D:\j2sdk1.4.0\bin>javac test.java
test.java:22: cannot resolve symbol
symbol  : method getContentPane  ()
location: class test
                Container cp=getContentPane();
                             ^
1 error
请问如何解决?
搜索更多相关主题的帖子: public cannot method 
2005-01-28 11:11



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-11802-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016503 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved