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

J2ME

开发平台:

Java

  1. package DrawTriangle;
  2. import javax.microedition.lcdui.*;
  3. import javax.microedition.midlet.*;
  4. import java.io.*;
  5. public class TriangleCanvas extends Canvas
  6. {
  7. public TriangleCanvas()
  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.         g.fillTriangle(30, 40, 30, 100, 10, 0) ;
  18.         
  19.         
  20.         }
  21. }