设为首页收藏本站

八达网

 找回密码
 注册
查看: 107|回复: 4
打印 上一主题 下一主题

保存代码

[复制链接]

101

主题

2

好友

5万

积分

光明执政官

[SvS]Heroes

战队
[SvS]
联赛ID
PY_Shmily
种族
Protoss

2010水友赛冠军 2009年度八达十大杰出青年

跳转到指定楼层
1
发表于 2009-3-25 14:02 |只看该作者 |倒序浏览
rerererererererrtrtr

新建 Microsoft Word 文档.rar

5.4 KB, 下载次数: 9

头像被屏蔽

0

主题

0

好友

1277

积分

禁止发言

2
发表于 2009-3-25 14:04 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复

使用道具 举报

yirankuyu 该用户已被删除
3
发表于 2009-3-25 14:22 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

15

主题

2

好友

7958

积分

大象

菠菜团

4
发表于 2009-3-25 14:26 |只看该作者
什么东西???
吾性本不色,更不黄也
回复

使用道具 举报

0

主题

0

好友

2万

积分

大和

5
发表于 2009-3-25 14:28 |只看该作者
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;


public class Midlet extends MIDlet        implements        CommandListener {
          private Display display;//显示对象的引用
          Command        okCommand;
          Command        exitCommand;
          int        viewType;
          List        list;
          canvasDraw        canvasdraw;
          public Midlet() {
                          canvasdraw=new        canvasDraw();
                          display=Display.getDisplay(this);
                        okCommand=new        Command("确认",Command.OK,2);
                        exitCommand=new        Command("离开",Command.EXIT,2);
                        list=new        List("线条几何形状绘制清单",List.IMPLICIT);
                        list.addCommand(okCommand);
                        list.addCommand(exitCommand);
                        list.append("绘制线条",null);
                        list.append("绘制矩形",null);
                        list.append("绘制圆角矩形",null);
                        list.append("绘制弧形",null);
                        list.append("绘制三角形",null);
                        list.append("绘制文本",null);
                        list.append("绘制图象",null);
                        list.addCommand(okCommand);
                        list.addCommand(exitCommand);
                        list.setCommandListener(this);
                                }       
          protected void startApp() {
         
             display.setCurrent(list);       
        }
          public        void        pauseApp(){}
          public        void        destroyApp(boolean        unconditional){}
          public        void        commandAction(Command        cmd,Displayable        disp){
                  viewType=list.getSelectedIndex();
                  if(cmd==okCommand)
                  {
                        display.setCurrent(canvasdraw);
                  }
                  else        if(cmd==exitCommand){
                          destroyApp(false);
                  }
          }
        class canvasDraw extends Canvas        implements        CommandListener{
                int        action=0;
                Image        handImage;
                int        changeSD=1;
                int        changeFull=0;
                Command        backCommand;
                public        canvasDraw(){
                        try{
                                handImage=Image.createImage("/hand.png");
                        }catch(Exception        ex){}
                        backCommand=new        Command("返回",Command.BACK,1);
                        addCommand(backCommand);
                        setCommandListener(this);
                }
               
                public        void paint(Graphics g)
                {
                        g.setColor(0xffffff);
                        g.fillRect(0,0,getWidth(),getHeight());
                        g.setColor(0);
                        if(viewType==0){
                                g.setColor(0x000000);
                                g.drawLine(10,10,getWidth() -20,10);
                                g.setColor(0xcdab00);
                                g.setStrokeStyle(Graphics.DOTTED);
                                g.drawLine(10,50,getWidth() -20,50);
                        }
                        if(viewType==1){
                                g.setColor(0xff0000 );
                                g.drawRect(10,25,getWidth() - 20,20);
                                g.setColor(0xffff00);
                                g.fillRect(11,26,getWidth() - 22,18);
                                g.setColor(0xff0000 );
                                g.drawRect(10,65,getWidth() - 20,20);
                                g.setColor(0xffff00);
                                g.fillRect(11,96,getWidth() - 22,18);
                               
                        }
                        else        if(viewType==2){
                                g.setColor(0x0000ff);
                                g.drawRoundRect(10,50,getWidth() -20,40,20,20);
                                g.setColor(0x00ffff);
                                g.fillRoundRect(10,100,getWidth() - 20,40,20,20 );
                               
                        }
                        else        if(viewType==3)
                        {
                                g.setColor(0xff0000);
                                g.drawArc(getWidth() / 2 - getWidth() / 8 ,
                                                getHeight() / 2 - getWidth() / 8,
                                                getWidth() / 4 ,        getWidth() /4 ,
                                                0,360);
                                g.setColor(0x00ff00);
                                g.fillArc(40,40,40,40,0,270 );       
                               
                        }
                        else        if(viewType==4)
                        {       
                                g.setColor(0x00ff00);
                                g.fillTriangle(40,40,100,40,60,100);
                        }
                        else        if(viewType==5)
                        {       
                                g.drawString("做好拉",150,
                                                150,Graphics.HCENTER|Graphics.TOP);
                        }
                        else        if(viewType==6)
                        {
                                g.drawImage(handImage,
                                                0, 0, Graphics.LEFT |Graphics.TOP );
                        }
                }
                public        void        commandAction(Command        cmd,Displayable        disp)
                {
                        if(cmd==backCommand)
                                display.setCurrent(list);
                }
        }
}


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

手机版|Archiver|八达网    

GMT+8, 2026-2-4 05:45

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部