用Java和XML建立试题库管理系统,试题库管理系统的设计
源代码在线查看: 例8-7.java
//example 8-7
import java.applet.Applet;
import java.awt.*;
import java.awt.image.*;
public class tt extends Applet
{
Image img;
public void init()
{
Dimension d=getSize();
int w=d.width,h=d.height;
int pix[]=new int[w*h];
int index=0;
for(int y=0;y for(int x=0;x {
int red=(x|y)&0xff;
int green=(x*4|y*4)*0xff;
int blue=(x*6|y*8)*0xff;
pix[index++]=(255 }
img=createImage(new MemoryImageSource(w,h,pix,0,w));
}
public void paint(Graphics g)
{
g.drawImage(img,0,0,this);
}
}