流
流浪者_2008
Unregistered / Unconfirmed
GUEST, unregistred user!
第一次接触Java,编译时候出现如下错误,不知如何解决,恳请帮助,谢谢!!
我已经将c:/jdk/bin加入到环境变量Path中了
C:/jdk/Java>javac TextTest.java
TextTest.java:5: package javax.swing.exentdo
es not exist
import javax.swing.exent.*;
^
TextTest.java:8: cannot resolve symbol
symbol : class string
location: class TextTest
public static void main(string[] args)
^
TextTest.java:78: cannot resolve symbol
symbol : classdo
ubel
location: class ClockPanel
privatedo
ubel HOUR_HAND_LENGTH=0.6*RADIUS;
^
TextTest.java:45: cannot resolve symbol
symbol : classdo
cumentListener
location: class TextTestFrame.ClockFieldListener
private class ClockFieldListener implementsdo
cumentListener
^
TextTest.java:47: cannot resolve symbol
symbol : classdo
cumentEvent
location: class TextTestFrame.ClockFieldListener
public void insertUpdate(DocumentEvent e){ setClock();};
^
TextTest.java:48: cannot resolve symbol
symbol : classdo
cumentEvent
location: class TextTestFrame.ClockFieldListener
public void removeUpdate(DocumentEvent e){ setClock();};
^
TextTest.java:49: cannot resolve symbol
symbol : classdo
cumentEvent
location: class TextTestFrame.ClockFieldListener
public void changeUpdate(DocumentEvent e){};
^
TextTest.java:21: cannot resolve symbol
symbol : class container
location: class TextTestFrame
container contentpane=getcontentpane();
^
TextTest.java:21: cannot resolve symbol
symbol : method getcontentpane ()
location: class TextTestFrame
container contentpane=getcontentpane();
^
TextTest.java:22: cannot resolve symbol
symbol : classdo
cumentListener
location: class TextTestFrame
DocumentListener Listener=new ClockFieldListener();
^
TextTest.java:28: cannot resolve symbol
symbol : variable JTextField
location: class TextTestFrame
Panel.add(JTextField);
^
TextTest.java:29: cannot resolve symbol
symbol : variable listener
location: class TextTestFrame
TextField.getDocument().addDocumentListener(listener);
^
TextTest.java:29: cannot resolve symbol
symbol : method getDocument ()
location: class java.awt.TextField
TextField.getDocument().addDocumentListener(listener);
^
TextTest.java:36: cannot resolve symbol
symbol : variable HourField
location: class TextTestFrame
int hours=Integer.parasint(HourField.getText().trim());
^
TextTest.java:37: cannot resolve symbol
symbol : variable MinutesField
location: class TextTestFrame
int minutes=Integer.parasint(MinutesField.getText().trim());
^
TextTest.java:63: missing method body, or declare abstract
public void drawHand(Graphics2D g2,double nagle,double handlength);
^
TextTest.java:65: cannot resolve symbol
symbol : variable RADIU
location: class ClockPanel
Point2D end=new Point2D.Double(RADIU+handlength*Math.cos(angle),
^
TextTest.java:65: cannot resolve symbol
symbol : variable handlength
location: class ClockPanel
Point2D end=new Point2D.Double(RADIU+handlength*Math.cos(angle),
^
TextTest.java:65: cannot resolve symbol
symbol : variable angle
location: class ClockPanel
Point2D end=new Point2D.Double(RADIU+handlength*Math.cos(angle),
^
TextTest.java:66: illegal forward reference
RADIUS-handlength*Math.sin(angle));
^
TextTest.java:66: cannot resolve symbol
symbol : variable handlength
location: class ClockPanel
RADIUS-handlength*Math.sin(angle));
^
TextTest.java:66: cannot resolve symbol
symbol : variable angle
location: class ClockPanel
RADIUS-handlength*Math.sin(angle));
^
TextTest.java:65: cannot resolve symbol
symbol : constructordo
uble (java.lang.String,double)
location: class java.awt.geom.Point2D.Double
Point2D end=new Point2D.Double(RADIU+handlength*Math.cos(angle),
^
TextTest.java:67: illegal forward reference
Point2D center=new Point2D.Double(RADIUS,RADIUS);
^
TextTest.java:67: illegal forward reference
Point2D center=new Point2D.Double(RADIUS,RADIUS);
^
TextTest.java:68: cannot resolve symbol
symbol : variable g2
location: class ClockPanel
g2.draw(new Line2D.Double(center,end));
^
TextTest.java:72: cannot resolve symbol
symbol : variable Minutes
location: class ClockPanel
Minutes=h*60+m;
^
27 errors
我想最重要的错误应该是以下两行,可能就是环境设置的问题吧
不知道还要设置那些呢?
TextTest.java:5: package javax.swing.exentdo
es not exist
import javax.swing.exent.*;
我已经将c:/jdk/bin加入到环境变量Path中了
C:/jdk/Java>javac TextTest.java
TextTest.java:5: package javax.swing.exentdo
es not exist
import javax.swing.exent.*;
^
TextTest.java:8: cannot resolve symbol
symbol : class string
location: class TextTest
public static void main(string[] args)
^
TextTest.java:78: cannot resolve symbol
symbol : classdo
ubel
location: class ClockPanel
privatedo
ubel HOUR_HAND_LENGTH=0.6*RADIUS;
^
TextTest.java:45: cannot resolve symbol
symbol : classdo
cumentListener
location: class TextTestFrame.ClockFieldListener
private class ClockFieldListener implementsdo
cumentListener
^
TextTest.java:47: cannot resolve symbol
symbol : classdo
cumentEvent
location: class TextTestFrame.ClockFieldListener
public void insertUpdate(DocumentEvent e){ setClock();};
^
TextTest.java:48: cannot resolve symbol
symbol : classdo
cumentEvent
location: class TextTestFrame.ClockFieldListener
public void removeUpdate(DocumentEvent e){ setClock();};
^
TextTest.java:49: cannot resolve symbol
symbol : classdo
cumentEvent
location: class TextTestFrame.ClockFieldListener
public void changeUpdate(DocumentEvent e){};
^
TextTest.java:21: cannot resolve symbol
symbol : class container
location: class TextTestFrame
container contentpane=getcontentpane();
^
TextTest.java:21: cannot resolve symbol
symbol : method getcontentpane ()
location: class TextTestFrame
container contentpane=getcontentpane();
^
TextTest.java:22: cannot resolve symbol
symbol : classdo
cumentListener
location: class TextTestFrame
DocumentListener Listener=new ClockFieldListener();
^
TextTest.java:28: cannot resolve symbol
symbol : variable JTextField
location: class TextTestFrame
Panel.add(JTextField);
^
TextTest.java:29: cannot resolve symbol
symbol : variable listener
location: class TextTestFrame
TextField.getDocument().addDocumentListener(listener);
^
TextTest.java:29: cannot resolve symbol
symbol : method getDocument ()
location: class java.awt.TextField
TextField.getDocument().addDocumentListener(listener);
^
TextTest.java:36: cannot resolve symbol
symbol : variable HourField
location: class TextTestFrame
int hours=Integer.parasint(HourField.getText().trim());
^
TextTest.java:37: cannot resolve symbol
symbol : variable MinutesField
location: class TextTestFrame
int minutes=Integer.parasint(MinutesField.getText().trim());
^
TextTest.java:63: missing method body, or declare abstract
public void drawHand(Graphics2D g2,double nagle,double handlength);
^
TextTest.java:65: cannot resolve symbol
symbol : variable RADIU
location: class ClockPanel
Point2D end=new Point2D.Double(RADIU+handlength*Math.cos(angle),
^
TextTest.java:65: cannot resolve symbol
symbol : variable handlength
location: class ClockPanel
Point2D end=new Point2D.Double(RADIU+handlength*Math.cos(angle),
^
TextTest.java:65: cannot resolve symbol
symbol : variable angle
location: class ClockPanel
Point2D end=new Point2D.Double(RADIU+handlength*Math.cos(angle),
^
TextTest.java:66: illegal forward reference
RADIUS-handlength*Math.sin(angle));
^
TextTest.java:66: cannot resolve symbol
symbol : variable handlength
location: class ClockPanel
RADIUS-handlength*Math.sin(angle));
^
TextTest.java:66: cannot resolve symbol
symbol : variable angle
location: class ClockPanel
RADIUS-handlength*Math.sin(angle));
^
TextTest.java:65: cannot resolve symbol
symbol : constructordo
uble (java.lang.String,double)
location: class java.awt.geom.Point2D.Double
Point2D end=new Point2D.Double(RADIU+handlength*Math.cos(angle),
^
TextTest.java:67: illegal forward reference
Point2D center=new Point2D.Double(RADIUS,RADIUS);
^
TextTest.java:67: illegal forward reference
Point2D center=new Point2D.Double(RADIUS,RADIUS);
^
TextTest.java:68: cannot resolve symbol
symbol : variable g2
location: class ClockPanel
g2.draw(new Line2D.Double(center,end));
^
TextTest.java:72: cannot resolve symbol
symbol : variable Minutes
location: class ClockPanel
Minutes=h*60+m;
^
27 errors
我想最重要的错误应该是以下两行,可能就是环境设置的问题吧
不知道还要设置那些呢?
TextTest.java:5: package javax.swing.exentdo
es not exist
import javax.swing.exent.*;