当前位置: 技术问答>java相关
java调试问题,请帮忙
来源: 互联网 发布时间:2015-10-20
本文导语: 小弟在编译java程序是出现一下问题。我用的是jdk1.4.0版,肯定配置好了,因为我得“helloworld"已经运行成功。请大家多多帮忙,谢谢。编译问题和程序见下: E:>javac Shapes2.java Shapes2.java:17: cannot resolve symbol symbol :...
小弟在编译java程序是出现一下问题。我用的是jdk1.4.0版,肯定配置好了,因为我得“helloworld"已经运行成功。请大家多多帮忙,谢谢。编译问题和程序见下:
E:>javac Shapes2.java
Shapes2.java:17: cannot resolve symbol
symbol : class Generalpath
location: class Shapes2
GeneralPath star=new Generalpath();
^
Shapes2.java:20: cannot resolve symbol
symbol : method lineto (int,int)
location: class java.awt.geom.GeneralPath
star.lineto(xPoints[k],yPoints[k]);
^
Shapes2.java:25: cannot resolve symbol
symbol : method rotate (double)
location: class java.awt.Graphics
{g2d.rotate(Math.PI/10.0);
^
Shapes2.java:26: cannot resolve symbol
symbol : method setcolor (java.awt.Color)
location: class java.awt.Graphics
g2d.setcolor(
^
Shapes2.java:30: cannot resolve symbol
symbol : method fill (java.awt.geom.GeneralPath)
location: class java.awt.Graphics
g2d.fill(star);
^
Shapes2.java:35: cannot resolve symbol
symbol : method paint ()
location: class Shapes2
app.paint();
^
Shapes2.java:36: cannot resolve symbol
symbol : method addWindowlistener ()
location: class Shapes2
app.addWindowlistener(
^
7 errors
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.awt.geom.GeneralPath;
public class Shapes2 extends JFrame{
public Shapes2()
{super ("drawing 2d shapes");
setBackground(Color.yellow);
setSize(400,400);
show();
}
public void paint(Graphics g)
{int xPoints[]={55,67,109,73,83,55,27,37,1,43};
int yPoints[]={0,36,36,54,96,72,96,54,36,36};
Graphics g2d =(Graphics2D) g;
GeneralPath star=new Generalpath();
star.moveTo(xPoints[0],yPoints[0]);
for(int k=1;k
E:>javac Shapes2.java
Shapes2.java:17: cannot resolve symbol
symbol : class Generalpath
location: class Shapes2
GeneralPath star=new Generalpath();
^
Shapes2.java:20: cannot resolve symbol
symbol : method lineto (int,int)
location: class java.awt.geom.GeneralPath
star.lineto(xPoints[k],yPoints[k]);
^
Shapes2.java:25: cannot resolve symbol
symbol : method rotate (double)
location: class java.awt.Graphics
{g2d.rotate(Math.PI/10.0);
^
Shapes2.java:26: cannot resolve symbol
symbol : method setcolor (java.awt.Color)
location: class java.awt.Graphics
g2d.setcolor(
^
Shapes2.java:30: cannot resolve symbol
symbol : method fill (java.awt.geom.GeneralPath)
location: class java.awt.Graphics
g2d.fill(star);
^
Shapes2.java:35: cannot resolve symbol
symbol : method paint ()
location: class Shapes2
app.paint();
^
Shapes2.java:36: cannot resolve symbol
symbol : method addWindowlistener ()
location: class Shapes2
app.addWindowlistener(
^
7 errors
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.awt.geom.GeneralPath;
public class Shapes2 extends JFrame{
public Shapes2()
{super ("drawing 2d shapes");
setBackground(Color.yellow);
setSize(400,400);
show();
}
public void paint(Graphics g)
{int xPoints[]={55,67,109,73,83,55,27,37,1,43};
int yPoints[]={0,36,36,54,96,72,96,54,36,36};
Graphics g2d =(Graphics2D) g;
GeneralPath star=new Generalpath();
star.moveTo(xPoints[0],yPoints[0]);
for(int k=1;k