Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区 » 实战错误讨论  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 参数非法?求教高手
ice0819





发贴: 17
积分: 1
于 2008-09-28 15:13 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list

import java.awt.*;
import java.awt.event.*;

public class Debug extends Frame{
  final String names[]={"1","2","3"};
  final Button [] buttons=new Button[3];
  String [] locations={"North","Sourth","Center"};
  
  
  public Debug(String s )
  { super(s);
  final BorderLayout layout = (BorderLayout)this.getLayout();
  
     ActionListener listener=new ActionListener()
     { public void actionPerformed( ActionEvent evt)
       {
                
       ((Button)evt.getSource()).setVisible(false);
       layout.layoutContainer(Debug.this);
       }  
     
     };
    
  
     for (int i=0;i<buttons.length;i++)
     {
   buttons[i]=new Button(names[i]);
   buttons[i].addActionListener(listener);
   add(buttons[i],locations[i]);
     }


setSize(100,100);
setVisible(true);
}

  
  public static void main(String[] args) {
    new Debug("Made by ice");
  }

}


编译正确,可是运行是,提示参数非法


JiafanZhou edited on 2008-09-29 16:18


话题树型展开
人气 标题 作者 字数 发贴时间
15303 参数非法?求教高手 ice0819 1496 2008-09-28 15:13
12109 Re:参数非法?求教高手 ice0819 12 2008-09-28 15:15
12045 Re:参数非法?求教高手 xuxiaolei 891 2008-09-29 06:39
12091 Re:参数非法?求教高手 ice0819 5 2008-09-29 08:52
11939 Re:参数非法?求教高手 xuxiaolei 26 2008-09-29 09:02
11980 Re:参数非法?求教高手 JiafanZhou 639 2008-09-29 16:24
12085 Re:参数非法?求教高手 ice0819 116 2008-09-29 16:35
12669 Re:参数非法?求教高手 JiafanZhou 194 2008-10-01 18:39

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923