为什么我的Eclipse运行不起图片输出applet程序?
packagebook;importjava.applet.Applet;importjava.awt.*;publicclassExam4_13extendsApple...
package book;
import java.applet.Applet;
import java.awt.*;
public class Exam4_13 extends Applet{
public void paint(Graphics g)
{
Image pic;
pic=getImage(getDocumentBase(),"1.jpg");
int x0=10,y0=30;
int w=pic.getWidth(this);
int h=pic.getHeight(this);
g.drawImage(pic,x0,y0,w/8,h/8,this);
g.drawImage(pic,x0+150,y0,w/12,h/12,this);
g.drawImage(pic,x0+150,y0+100,w/12,h/12,this);
g.drawImage(pic,x0+250,y0+30,(int)(w*0.1),(int)(h*0.2),this);
}
}
这是源代码,在dos命令和浏览器下能运行,但是就是在Eclipse下不能运行;求高手指点下咯! 展开
import java.applet.Applet;
import java.awt.*;
public class Exam4_13 extends Applet{
public void paint(Graphics g)
{
Image pic;
pic=getImage(getDocumentBase(),"1.jpg");
int x0=10,y0=30;
int w=pic.getWidth(this);
int h=pic.getHeight(this);
g.drawImage(pic,x0,y0,w/8,h/8,this);
g.drawImage(pic,x0+150,y0,w/12,h/12,this);
g.drawImage(pic,x0+150,y0+100,w/12,h/12,this);
g.drawImage(pic,x0+250,y0+30,(int)(w*0.1),(int)(h*0.2),this);
}
}
这是源代码,在dos命令和浏览器下能运行,但是就是在Eclipse下不能运行;求高手指点下咯! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询