logger.java

来自「A Java Framework for connecting to and e」· Java 代码 · 共 50 行

JAVA
50
字号
/*
 * Logger.java
 *
 * Created on 4. November 2004, 10:59
 */

package com.libGPS4j2me.devices.StdGPS.log;

import javax.microedition.lcdui.TextBox;

/**
 * Logger to enable debugging on mobile device.
 *
 * @author  Dominik Schmidt
 */
public class Logger extends TextBox {
    /**
     * Creatse new logger.
     * 
     * @param title Title to be displayed
     * @param size Size of underlaying TextBox
     * @param type Type of underlaying TextBox
     */
    public Logger(String title, int size, int type) {
        super(title, "", size, type);
    }
    
    /**
     * Appends a string to the end of the TextBox.
     * 
     * @param text String to append
     */ 
    public void appendString(String text) {
        super.setString(this.getString() + "\n" + text);
    }
    
    /**
     * Appends a single character to the end of the TextBox.
     * 
     * @param i ASCII-Code of character to append
     */
    public void appendInt(int i) {
        super.setString(this.getString() + ((char) i));// + "[" + i + "]");
    }
    
    public void setString(String text) {
        super.setString(text);
    }
}

⌨️ 快捷键说明

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