| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 834 人关注过本帖
标题:一个小程序,有错,请教
取消只看楼主 加入收藏
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
快速回复:一个小程序,有错,请教
数据加载中...
 
   



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

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