fcheck.java

来自「一个简单的手机开发应用程序。 思想是从xml文件读入设置」· Java 代码 · 共 40 行

JAVA
40
字号
package core.ui.control;

import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Item;

public class FCheck { //extends Item{

   public FCheck(String label){
      //super(label);
   }

   protected void paint(Graphics g){
      //清除屏幕 
      /*int color = g.getColor();
      g.setColor(0xFFCCFF);
      g.fillRect(0, 0, getWidth(), getHeight());
      g.setColor(color);
      //计算整个菜单的高度,宽度和(x,y) 
      int rectWidth = preferWidth;
      int rectHeight = preferHeight * LABELS.length;
      int x = (getWidth() - rectWidth) / 2;
      int y = (getHeight() - rectHeight) / 2;
      //画矩形 
      g.drawRect(x, y, rectWidth, rectHeight);
      for(int i = 1; i < LABELS.length; i++){
         g.drawLine(x, y + preferHeight * i, x + rectWidth, y + preferHeight * i);
      }
      //画菜单选项,并根据selected的值判断焦点 
      for(int j = 0; j < LABELS.length; j++){
         if(selected == j){
            g.setColor(0x6699cc);
            g.fillRect(x + 1, y + j * preferHeight + 1, rectWidth - 1, preferHeight - 1);
            g.setColor(color);
         }
         g.drawString(LABELS[j], x + 8, y + j * preferHeight + 4, Graphics.LEFT | Graphics.TOP);
      }*/
   }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?