用NetBeans写了和读取图片的小程序。可以正常编译和运行,问:我该把图片放哪里可以显示??
packagesimpledrawer;importjava.awt.*;importjava.applet.Applet;publicclassG29extendsAp...
package simpledrawer;
import java.awt.*;
import java.applet.Applet;
public class G29 extends Applet
{
Image img;
@Override
public void init()
{
img=getImage(getCodeBase(),"Cursor1.GIF");
}
@Override
public void paint(Graphics g)
{
g.drawImage(img, 20, 10, this);
}
} 展开
import java.awt.*;
import java.applet.Applet;
public class G29 extends Applet
{
Image img;
@Override
public void init()
{
img=getImage(getCodeBase(),"Cursor1.GIF");
}
@Override
public void paint(Graphics g)
{
g.drawImage(img, 20, 10, this);
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询