请高手们帮个小忙,本人不胜感激! 照样能用的,只要达到目的就行了,何必非要用最新的呢?况且java是向下兼容的。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 import java.applet.Applet;import java.awt.Graphics;import java.awt.Image;public class BackgroundImage extends Applet{ Image picture; boolean imageLoaded = false; public void init() { picture = getImage(getCodeBase(), "Image.gif"); // 装载图像 Image offScreenImage = createImage(this.getSize().width, this.getSize().height); Graphics offScreenGC = offScreenImage.getGraphics(); // 获取Graphics对象 offScreenGC.drawImage(picture, 0, 0, this); // 显示非屏幕图像 } public void paint(Graphics g) { if (imageLoaded) { g.drawImage(picture, 0, 0, null); // 显示图像,第四参数为null,不是this showStatus("Done"); } else showStatus("Loading image"); } public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) { if (infoflags == ALLBITS) { imageLoaded = true; repaint(); return false; } else return true; }}主要是把size()改成getSize()你的小错误好多啊。比较下好了 滚动字问题 swing 文本框 文本内容怎么设置连接 求信息发布接口的代码作一下参考!急!急! 菜鸟求助!jframe里可不可以嵌套jframe? 三层c/s和三层b/s的优越性比较? Super 一个有关Calendar的小问题! 离奇加变态的问题 java.lang.NoClassDefFoundError 帮忙解释一个很简单的问题 菜鸟问题:请教java的学习方法? 两个32位二进制数按位与、或 操作? 请问有知了解javadoc的来介绍下么?
import java.awt.Graphics;
import java.awt.Image;public class BackgroundImage extends Applet
{
Image picture; boolean imageLoaded = false; public void init()
{
picture = getImage(getCodeBase(), "Image.gif"); // 装载图像
Image offScreenImage = createImage(this.getSize().width,
this.getSize().height); Graphics offScreenGC = offScreenImage.getGraphics(); // 获取Graphics对象
offScreenGC.drawImage(picture, 0, 0, this); // 显示非屏幕图像
} public void paint(Graphics g)
{
if (imageLoaded)
{
g.drawImage(picture, 0, 0, null); // 显示图像,第四参数为null,不是this
showStatus("Done");
} else
showStatus("Loading image");
} public boolean imageUpdate(Image img, int infoflags, int x, int y, int w,
int h)
{
if (infoflags == ALLBITS)
{
imageLoaded = true;
repaint();
return false;
} else
return true;
}
}主要是把size()改成getSize()
你的小错误好多啊。比较下好了