J2ME中文教程 3 MIDP高级UI 的使用[27]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

 

    public Table(String title, Display d) {

        super(title);

        display = d;

        setDefaultCommand(CMD_EDIT);

        setItemCommandListener(this);

        int interactionMode = getInteractionModes();

        horz = ((interactionMode & CustomItem.TRAVERSE_HORIZONTAL) != 0);

        vert = ((interactionMode & CustomItem.TRAVERSE_VERTICAL) != 0);

    }

 

    protected int getMinContentHeight() {

 

        return (rows * dy) + 1;

    }

 

    protected int getMinContentWidth() {

 

        return (cols * dx) + 1;

    }

 

    protected int getPrefContentHeight(int width) {

 

        return (rows * dy) + 1;

    }

 

    protected int getPrefContentWidth(int height) {

 

        return (cols * dx) + 1;

    }

 

    protected void paint(Graphics g, int w, int h) {

 

        for (int i = 0; i <= rows; i++) {

            g.drawLine(0, i * dy, cols * dx, i * dy);

本文关键:J2ME中文教程 3 MIDP高级UI 的使用
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top