applet的打印(求助)
import java.awt.Graphics; import javax.swing.JApplet; public class CoutnPf extends JApplet{ int i = 0,square = 0,cube = 0; int y = 25;
public void paint(Graphics g) { super.paint(g); g.drawString("number\tsquare\tcube",25,y); for( ; i <= 10 ; i++) { g.drawString(i + square + cube ,25,y); y = y + 20; square = pow(i,2); cube = square * i; } } }
[此贴子已经被作者于2005-9-21 10:47:19编辑过]