爱问知识人 爱问教育 医院库

java能编译,为什么不能执行啊,我是照书上打的!

首页

java能编译,为什么不能执行啊,我是照书上打的!

 t.*;publicclassFiveButtons{publicstaticvoidmain(Stringargs[]){Framef=newFrame("BorderLayout");tLayout(newBorderLayout());d("北",newButton("North"));d("南",newButton("South"));d("东",newButton("East"));d("西",newButton("West"));d("中",newButton("Center"));tSize(100,100);tVisible(true);}}

提交回答
好评回答
  • 2007-12-27 13:57:21
    你的英文与中文的地方放反了.像这样就行了.
     d("North", new Button("北")); 
     d("South", new Button("南")); 
     d("East", new Button("西")); 
     d("West", new Button("东")); 
     d("Center", new Button("中"));
    不要绝对的相信书上的东西.它也有错的时候.

    g***

    2007-12-27 13:57:21

其他答案

    2008-01-01 20:24:19
  • 你的书是盗版的所以不要一味迷信书上的东西楼上说的都不错! t.*;publicclassFiveButtons{publicstaticvoidmain(Stringargs[]){Framef=newFrame("BorderLayout");tLayout(newBorderLayout());d("North",newButton("North"));d("South",newButton("South"));d("East",newButton("East"));d("West",newButton("West"));d("Center",newButton("Center"));tSize(100,100);tVisible(true);}}

    碧***

    2008-01-01 20:24:19

  • 2007-12-26 19:01:22
  • 如果你用ECLIPSE编译,把你工程字符集改成UTF-8就支持中文了在“工程名”上右击,选择“properties”--->"Info"--->"Textfileencoding"--->" "

    k***

    2007-12-26 19:01:22

  • 2007-12-25 21:40:04
  •   你的源程序
     t。*;public class FiveButtons{ 
    public static void main(String args[]){ 
    Frame f = new Frame("BorderLayout"); 
     tLayout(new BorderLayout()); 
     d("北", new Button("North")); 
     d("南", new Button("South")); 
     d("东", new Button("East")); 
     d("西", new Button("West")); 
     d("中", new Button("Center"));//这里的“北,南,东,西,中”五个汉字应该用英文单词,这里是作为固定参数出现的 
     tSize(100,100); 
     tVisible(true); 
    } 
    } 
    修改后的程序
     t。
      *;public class FiveButtons{ public static void main(String args[]){ Frame f = new Frame("BorderLayout"); tLayout(new BorderLayout()); d("North", new Button("North")); d("South", new Button("South")); d("East", new Button("East")); d("West", new Button("West")); d("Center", new Button("Center")); tSize(100,100); tVisible(true); } }。
      

    热***

    2007-12-25 21:40:04

类似问题

换一换

相关推荐

正在加载...
最新资料 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 176-195
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):