tabledemo.java

来自「一个j2me上的电子表格的实现代码」· Java 代码 · 共 38 行

JAVA
38
字号
/*
 * TableDemo.java
 *
 * Created on 2006年7月2日, 下午3:59
 */

package cn.edu.uestc.table;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

/**
 *
 * @author  pandaxiaoxi
 * @version
 */
public class TableDemo extends MIDlet {
    private Display display = null;
    public void startApp() {
        display = Display.getDisplay(this);
        Table table = new Table(new TableModel(){
            public int getColumnCount(){return 3;}
            public int getRowCount(){return 5;}
            public String getColumnHeaderText(int col){return Integer.toString(col)+"列";}
            public boolean hasColumnHeaders(){return true;}
            public String getValueAt(int row,int col){return Integer.toString(row)+"."+Integer.toString(col);}
                      
        });
        display.setCurrent(table);
    }
    
    public void pauseApp() {
    }
    
    public void destroyApp(boolean unconditional) {
    }
}

⌨️ 快捷键说明

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