LineCanvas.java
资源名称:J2ME&Game.rar [点击查看]
上传用户:gyyuli
上传日期:2013-07-09
资源大小:3050k
文件大小:1k
源码类别:
J2ME
开发平台:
Java
- package DrawLine;
- import javax.microedition.lcdui.*;
- import javax.microedition.midlet.*;
- import java.io.*;
- public class LineCanvas extends Canvas
- {
- public LineCanvas()
- {
- }
- public void paint(Graphics g)
- {
- g.setColor(0xFFFFFF);
- g.fillRect(0, 0, getWidth(), getHeight());
- g.setColor(0x000000);
- /* g.drawLine(0,1,0,4);
- g.drawLine(2,2,5,5);
- g.drawLine(1,2,2,8);
- g.drawLine(1,0,5,0);
- g.drawLine(6,2,6,2);*/
- g.drawLine(0,0,getWidth(),getHeight());
- g.drawLine(60,70,30,20);
- g.drawLine(30,50,60,80);
- g.drawLine(100,30,40,90);
- }
- }