警察局备案有什么影响:java程序编译时

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/04 07:00:27
import java.awt.*;
import java.awt.event.*;
public class TwoListenInner {
private Frame f;
private TextField tf;
public static void main(String args[]) {
TwoListenInner that=new TwoListenInner();
that.go();
}

public void go() {
f=new Frame("Two listeners example");
f.add("North",new Label("Click and drag the mouse"));
tf=new TextField(30);
f.add("South",tf);
f.addMouseMotionListener(new MouseMotionHandler());
f.addMouseListener(new MouseEventHandler());
f.setSize(300,300);
f.setVisible(true);
}
public class MouseMotionHandler extends MouseMotionAdapter {
public void mouseDragged(MouseEvent e){
String s="Mouse dragging:X="+e.getX()+"Y="+e.getY();
tf.setText(s);
}
}
public class MouseEventHandler extends MouseAdapter {
public void mouseEntered(MouseEvent e){
String s="The mouse entered";
tf.setText(s);
}
public void mouseExited(MouseEvent e){
String s="The mouse left the building";
tf.setText(s);
}
}
}
我把它保存为TwoListenInner.java
用javac编译时产生好多错误.这个例子是网上的.我想不会有错.
是不是环境变量有问题.可这边这个.我把它保存为HelloWorld .JAVA
用javac编译时就没有错.气死我了.请业内人士帮助呀.谢谢了先
public class HelloWorld {
public static void main(String aaa[]) {
System.out.println("Hello World!");

}
}

我把它保存为TwoListenInner.java 用javac编译时没问题啊。还能执行

import java.awt.*;
import java.awt.event.*;
public class TwoListenInner {
private Frame f;
private TextField tf;
public static void main(String args[]) {
TwoListenInner that=new TwoListenInner();
that.go();
}

public void go() {
f=new Frame("Two listeners example");
f.add("North",new Label("Click and drag the mouse"));
tf=new TextField(30);
f.add("South",tf);
f.addMouseMotionListener(new MouseMotionHandler());
f.addMouseListener(new MouseEventHandler());
f.setSize(300,300);
f.setVisible(true);
}
public class MouseMotionHandler extends MouseMotionAdapter {
public void mouseDragged(MouseEvent e){
String s="Mouse dragging:X="+e.getX()+"Y="+e.getY();
tf.setText(s);
}
}
public class MouseEventHandler extends MouseAdapter {
public void mouseEntered(MouseEvent e){
String s="The mouse entered";
tf.setText(s);
}
public void mouseExited(MouseEvent e){
String s="The mouse left the building";
tf.setText(s);
}
}
}
我把它保存为TwoListenInner.java
用javac编译时产生好多错误.这个例子是网上的.我想不会有错.
是不是环境变量有问题.可这边这个.我把它保存为HelloWorld .JAVA
用javac编译时就没有错.气死我了.请业内人士帮助呀.谢谢了先
public class HelloWorld {
public static void main(String aaa[]) {
System.out.println("Hello World!");

}
}