LineCanvas.java
上传用户:gyyuli
上传日期:2013-07-09
资源大小:3050k
文件大小:1k
源码类别:

J2ME

开发平台:

Java

  1. package DrawLine;
  2. import javax.microedition.lcdui.*;
  3. import javax.microedition.midlet.*;
  4. import java.io.*;
  5. public class LineCanvas extends Canvas
  6. {
  7. public LineCanvas()
  8.         {
  9.         
  10.         
  11.         }
  12.         public void paint(Graphics g)
  13.         {
  14.         g.setColor(0xFFFFFF);
  15.         g.fillRect(0, 0, getWidth(), getHeight());
  16.         g.setColor(0x000000);
  17.         
  18.        /* g.drawLine(0,1,0,4);
  19.         g.drawLine(2,2,5,5);
  20.         g.drawLine(1,2,2,8);
  21.         g.drawLine(1,0,5,0);
  22.         g.drawLine(6,2,6,2);*/
  23.         g.drawLine(0,0,getWidth(),getHeight());
  24.         g.drawLine(60,70,30,20);
  25.         g.drawLine(30,50,60,80);
  26.         g.drawLine(100,30,40,90);
  27.         
  28.         }
  29. }