help me!What is worry??? wo zhe li mei you zhong wen shu ru fa.wo shi chu xue zhe,xi wang da ge men bang mang! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 da ge men bang mang kan yi xia ma. wei sen me zai JDk1.2.2 xia de "javac.exe" bu neng tong guo ? 改改:import java.awt.*;import java.awt.event.*;public class FrameInOut extends Frame implements ActionListener{ Label output; TextField in1=new TextField(4),in2=new TextField(4),in3=new TextField(4); int x,y,z,max; Button ok=new Button("OK"),exit=new Button("exit");public FrameInOut(){ super("MAX"); this.setLayout(new GridLayout(3,3,1,1)); add(in1); add(in2); add(in3); add(ok); add(exit); ok.addActionListener(this); exit.addActionListener(this); setSize(400,400); show(); } public void actionPerformed(ActionEvent e){ if(e.getSource()==ok) x=Integer.parseInt(in1.getText()); y=Integer.parseInt(in2.getText()); z=Integer.parseInt(in3.getText()); if(x>y) if(x>z) max=x; else max=z; else if(y>z) max=y; else max=z; output.setText(" The max is:"+max);}public static void main(String args[]){ new FrameInOut(); }} 改改:file FrameInOut.javaimport java.awt.*;import java.awt.event.*;public class FrameInOut extends Frame implements ActionListener{ Label output; TextField in1=new TextField(4),in2=new TextField(4),in3=new TextField(4); int x,y,z,max; Button ok=new Button("OK"),exit=new Button("exit");public FrameInOut(){ super("MAX"); this.setLayout(new GridLayout(3,3,1,1)); add(in1); add(in2); add(in3); add(ok); add(exit); ok.addActionListener(this); exit.addActionListener(this); setSize(400,400); show(); } public void actionPerformed(ActionEvent e){ if(e.getSource()==ok) x=Integer.parseInt(in1.getText()); y=Integer.parseInt(in2.getText()); z=Integer.parseInt(in3.getText()); if(x>y) if(x>z) max=x; else max=z; else if(y>z) max=y; else max=z; output.setText(" The max is:"+max);}public static void main(String args[]){ new FrameInOut(); }} 下面是我编译时的提示,希望能让你看得更清楚:D:\>javac number.javanumber.java:26: 期望class或interfacepublic void actionPerformed(ActionEvent e) ^number.java:44: 期望class或interface}^number.java:44: 期望class或interface} ^number.java:8: FrameInOut 必须声明为 abstract; 它没有在 FrameInOut 中定义 actionPerformed(java.awt.event.ActionEvent)class FrameInOut extends Frame implements ActionListener{^4 个错误 4 个错误我 ye kan dao le,ke shi gai zen me ban ne ???xi wang ge ge men bang bang wo !!!xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie xie !!!!!!! show(); } } <--------------------去掉这个括号,就可以编译通过,不过好像你的程序有问题public void actionPerformed(ActionEvent e){ 不过,没加上Label output,也没有退出控制程序。 天哪!用缺省的BorderLayout,却连用好几个add()结果所有的控件都加到Center,如果要用BorderLayout应该add(...,"North"),add(...,"East")等等,至于没加上Label output,也没有退出控制程序等等就不说了。更不应该的是 在 if (e.getSource()==ok) 以及里面的if的后面不加括号{ !!!!!if(e.getSource()==ok) {//《===== x=Integer.parseInt(in1.getText()); y=Integer.parseInt(in2.getText()); z=Integer.parseInt(in3.getText()); if(x>y) if(x>z) max=x; else max=z; else if(y>z) max=y; else max=z; output.setText(" The max is:"+max);}//〈==== 今天总算是装了个中文的操作系统,日文的太麻烦了!我首先要谢谢哥哥们,这个经过哥哥们的爱心,后来已经通过了,我非常感谢大家,所以想给你们多加点分,可是我这个帖子给的最高分是23分,怎么才能加到100呢?另外,我是个菜鸟,刚刚学习JAVA,以后还要哥哥们多多指点,小弟先谢谢了! 关于方法覆盖的返回值类型的疑问 新手求意见 定义的一学生类,并创建类的对象。 JAVA的根本,是不是把类和其提供的方法学会 一道面试题...不懂! 那种数据没读完整前只显示图片loading。。。的效果是如何实现的? tomcat启动出现问题 如何使被压在下面的label显示到最上层 关于jar文件的问题 自定义函数调用问题 谁有jbuilder7.0的sn和key,请贴出来或者给到我的邮箱[email protected],谢谢大家 请问是不是每问一个问题才会长一分?指的是给分的上限。 这个在线游戏是如何实现的?
import java.awt.event.*;public class FrameInOut extends Frame implements ActionListener{
Label output;
TextField in1=new TextField(4),in2=new TextField(4),in3=new TextField(4);
int x,y,z,max;
Button ok=new Button("OK"),exit=new Button("exit");
public FrameInOut(){
super("MAX");
this.setLayout(new GridLayout(3,3,1,1));
add(in1);
add(in2);
add(in3);
add(ok);
add(exit);
ok.addActionListener(this);
exit.addActionListener(this);
setSize(400,400);
show();
} public void actionPerformed(ActionEvent e)
{
if(e.getSource()==ok)
x=Integer.parseInt(in1.getText());
y=Integer.parseInt(in2.getText());
z=Integer.parseInt(in3.getText());
if(x>y)
if(x>z)
max=x;
else
max=z;
else
if(y>z)
max=y;
else
max=z;
output.setText(" The max is:"+max);
}
public static void main(String args[]){
new FrameInOut();
}
}
import java.awt.event.*;public class FrameInOut extends Frame implements ActionListener{
Label output;
TextField in1=new TextField(4),in2=new TextField(4),in3=new TextField(4);
int x,y,z,max;
Button ok=new Button("OK"),exit=new Button("exit");
public FrameInOut(){
super("MAX");
this.setLayout(new GridLayout(3,3,1,1));
add(in1);
add(in2);
add(in3);
add(ok);
add(exit);
ok.addActionListener(this);
exit.addActionListener(this);
setSize(400,400);
show();
} public void actionPerformed(ActionEvent e)
{
if(e.getSource()==ok)
x=Integer.parseInt(in1.getText());
y=Integer.parseInt(in2.getText());
z=Integer.parseInt(in3.getText());
if(x>y)
if(x>z)
max=x;
else
max=z;
else
if(y>z)
max=y;
else
max=z;
output.setText(" The max is:"+max);
}
public static void main(String args[]){
new FrameInOut();
}
}
number.java:26: 期望class或interface
public void actionPerformed(ActionEvent e)
^
number.java:44: 期望class或interface
}
^
number.java:44: 期望class或interface
}
^
number.java:8: FrameInOut 必须声明为 abstract; 它没有在 FrameInOut 中定义 action
Performed(java.awt.event.ActionEvent)
class FrameInOut extends Frame implements ActionListener{
^
4 个错误
show();
}
} <--------------------去掉这个括号,就可以编译通过,不过好像你的程序有问题
public void actionPerformed(ActionEvent e)
{
用缺省的BorderLayout,却连用好几个add()结果所有的控件都加到Center,如果要用BorderLayout应该add(...,"North"),add(...,"East")等等,至于没加上Label output,也没有退出控制程序等等就不说了。
更不应该的是 在 if (e.getSource()==ok) 以及里面的if的后面不加括号{ !!!!!
if(e.getSource()==ok) {//《=====
x=Integer.parseInt(in1.getText());
y=Integer.parseInt(in2.getText());
z=Integer.parseInt(in3.getText());
if(x>y)
if(x>z)
max=x;
else
max=z;
else
if(y>z)
max=y;
else
max=z;
output.setText(" The max is:"+max);
}//〈====
我首先要谢谢哥哥们,这个经过哥哥们的爱心,后来已经通过了,我非常感谢大家,所以想给你们多加点分,可是我这个帖子给的最高分是23分,怎么才能加到100呢?
另外,我是个菜鸟,刚刚学习JAVA,以后还要哥哥们多多指点,小弟先谢谢了!