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

J2ME

开发平台:

Java

  1. package StrokeStyle;
  2. import javax.microedition.lcdui.*;
  3. import javax.microedition.midlet.*;
  4. import java.io.*;
  5. public class StrokeStyleCanvas extends Canvas
  6. {
  7. public StrokeStyleCanvas()
  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(0x0FF000);
  17.         g.setStrokeStyle(Graphics.SOLID);        
  18.         g.drawLine(0,30,120,30);
  19.         g.drawLine(10,20,20,80);
  20.         
  21.         g.setStrokeStyle(Graphics.DOTTED);
  22.         g.drawLine(10,20,100,20);
  23.         g.drawLine(5,50,5,50);
  24.         
  25.         }
  26. }