• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java StringItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.microedition.lcdui.StringItem的典型用法代码示例。如果您正苦于以下问题:Java StringItem类的具体用法?Java StringItem怎么用?Java StringItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StringItem类属于javax.microedition.lcdui包,在下文中一共展示了StringItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: cycleDemoStyles

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
public static void cycleDemoStyles(boolean demo) {
    try{
    //Below exists to make the style pop into code if it exists.
    //#style demotitle?
    UiAccess.setStyle(new StringItem("test","test"));
    //#style normaltitle?
    UiAccess.setStyle(new StringItem("test","test"));

    Style title = StyleSheet.getStyle("title");
    Style demotitle = StyleSheet.getStyle("demotitle");
    Style normaltitle = StyleSheet.getStyle("normaltitle");
    if(title == null || demotitle == null || normaltitle ==null) {
        return;
    }
    if(demo) {
        title.background = demotitle.background;
    } else {
        title.background = normaltitle.background;
    }
    } catch (Exception e) {
        //Don't worry about this, this is all gravy anyway
        e.printStackTrace();
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:25,代码来源:CommCareUtil.java


示例2: addRMSInfoJ2MEOnly

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
private void addRMSInfoJ2MEOnly () {
    try {
        String[] stores = RecordStore.listRecordStores();
        for (int i = 0; i < stores.length; i++) {
            String rmsName = stores[i];
            RecordStore rms = RecordStore.openRecordStore(rmsName, false);
            int size = rms.getSize();
        //    int avail = rms.getSizeAvailable();
            int numRecs = rms.getNumRecords();
            int perRecord = (numRecs == 0 ? -1 : size / numRecs);

            this.append(new StringItem(null, rmsName));
            this.append(new StringItem(null, "Used: " + formatBytes(size)));
            this.append(new StringItem(null, "Records: " + numRecs + (numRecs > 0 ? " (" + formatBytes(perRecord) + " per record)" : "")));
            //this.append(new StringItem(null, "Available: " + formatBytes(avail)));
        }
    } catch (RecordStoreException rse) { }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:19,代码来源:PropertiesScreen.java


示例3: AboutForm

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
public AboutForm(WandersmannMIDlet midlet) {
    super("About Wandersmann");

    this.midlet = midlet;

    append(new StringItem("Name", midlet.getAppProperty("MIDlet-Name")));
    append(new StringItem("Version", midlet.getAppProperty("MIDlet-Version")));
    append(new StringItem("Author", midlet.getAppProperty("MIDlet-Vendor")));
    append(new Spacer(getWidth(), 5));
    append("Geodata � OpenStreetMap and contributors, CC-BY-SA");
    append(new Spacer(getWidth(), 5));
    append("This program is free software: you can redistribute it and/or modify"
            + " it under the terms of the GNU General Public License as published by "
            + "the Free Software Foundation, either version 3 of the License, or "
            + "(at your option) any later version.");

    addCommand(BACK);
    setCommandListener(this);
}
 
开发者ID:cli,项目名称:worldmap-classic,代码行数:20,代码来源:AboutForm.java


示例4: RecordStoreForm

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
public RecordStoreForm() {
super("RecordStore");
addCommand(loadCommand);
addCommand(storeCommand);
addCommand(deleteCommand);
addCommand(listCommand);

textFiled = new TextField("Enter data", "", 128, TextField.ANY);
append(textFiled);

stringItem = new StringItem("Loaded data", "n/a");
append(stringItem);

messageItem = new StringItem("Info:", "Use menu to load and store data");
append(messageItem);
  }
 
开发者ID:freeVM,项目名称:freeVM,代码行数:17,代码来源:RecordStoreForm.java


示例5: HTTPPanel

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
public HTTPPanel() {
	super("HTTP Connection");
	
	String host = SimpleDemoMIDlet.instance.getAppProperty("microemu.accessible.host");
	if (host == null) {
		demoLocation = "http://www.microemu.org/test/";
	} else {
		demoLocation = "http://" + host + "/test/";
	}
	
	append(url = new TextField("URL:", demoLocation, 128, TextField.URL));
	append(message = new StringItem("Message:", null));
	append(status = new StringItem("Status:", null));
	
	addCommand(goCommand);
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:17,代码来源:HTTPPanel.java


示例6: waitForInput

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
/**
 * Blocks current thread until some text is put
 * into text field and "input" button is pressed.
 */
private synchronized String waitForInput() {
		input.setString("");
		append(input);
		inputvisible = true;
		addCommand(cmdInput);
		try {
			wait();
		} catch (InterruptedException ie) {
			print("interrupted");
		}
		delete(size()-1);
		append(new StringItem(input.getLabel(), input.getString()+'\n'));
		inputvisible = false;
		removeCommand(cmdInput);
		return input.getString()+'\n';
}
 
开发者ID:SBasalaev,项目名称:alchemy-os,代码行数:21,代码来源:TerminalForm.java


示例7: setupFields

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
private void setupFields() {
	imageItem = new ImageItem("Category: " + note.getCategory().toString(), note.getCategory().getIcon(), 0, "ctgimg");
	titleItem = new StringItem("Title", null);
	titleItem.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_LARGE));
	contentItem = new StringItem("Content", null);
	dateItem = new StringItem("Date", null);
	priorityItem = new StringItem("Priority", null);
	this.append(imageItem);
	this.append(titleItem);
	this.append(contentItem);
	this.append(dateItem);
	this.append(priorityItem);
}
 
开发者ID:NotesTeam,项目名称:TaskBook-J2ME,代码行数:14,代码来源:ShowNoteForm.java


示例8: FormTransportSubmitStatusScreen

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
public FormTransportSubmitStatusScreen(CommandListener listener, TransportResponseProcessor responder) {
    //#style submitPopup
    super(Localization.get("sending.status.title"));
    setCommandListener(listener);
    this.responder = responder;

    //#style submitText
    this.msg = new StringItem(null, Localization.get("sending.status.going"));
    append(new Spacer(80, 0));
    append(this.msg);
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:12,代码来源:FormTransportSubmitStatusScreen.java


示例9: setMessage

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
private void setMessage() {
    append(new Spacer(80, 0));
    if (this.ids.size() == 0) {
        this.msg = new StringItem(null, Localization.get("sending.status.none"));
    } else {
        this.msg = new StringItem(null, getCurrentDisplay());
    }
    append(this.msg);

}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:11,代码来源:MultiSubmitStatusScreen.java


示例10: RecordForm

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
public RecordForm(){
    super("Record Audio");
    messageItem = new StringItem("Record", "Click record to start recording.");
    this.append(messageItem);
    errorItem = new StringItem("", "");
    this.append(errorItem);
    recordCommand = new Command("Record", Command.SCREEN, 1);
    this.addCommand(recordCommand);
    playCommand = new Command("Play", Command.SCREEN, 2);
    this.addCommand(playCommand);
   // StringBuffer inhalt = new StringBuffer();
    this.setCommandListener(this);
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:14,代码来源:RecordMIDlet.java


示例11: RecorderForm

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
public RecorderForm()
{
    super("Record Audio");
    messageItem = new StringItem("", "Press Record to start recording.");
    append(messageItem);
    errorItem = new StringItem("", "");
    append(errorItem);
    //StringBuffer inhalt = new StringBuffer();
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:10,代码来源:AudioCaptureState.java


示例12: loadLogs

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
private void loadLogs() {
    view.deleteAll();
    this.view.removeCommand(ok);
    try {
        //TODO: Start from other end of logs
        Logger._().serializeLogs(new StreamLogSerializer() {

            String prevDateStr;

            protected void serializeLog(LogEntry entry) throws IOException {
                String fullDateStr = DateUtils.formatDateTime(entry.getTime(), DateUtils.FORMAT_ISO8601).substring(0, 19);
                String dateStr = fullDateStr.substring(11);
                if (prevDateStr == null || !fullDateStr.substring(0, 10).equals(prevDateStr.substring(0, 10))) {
                    view.append("= " + fullDateStr.substring(0, 10) + " =");
                }
                prevDateStr = fullDateStr;

                String line = dateStr + ":" + entry.getType() + "> " + entry.getMessage();

                view.append(new StringItem("", line));

            }
        }, max_entries);

    } catch (IOException e) {
        view.append(new StringItem("", "Error reading logs..."));
    }

    int count = Logger._().logSize();
    if(count > max_entries) {
        view.append("..." + count + " More");
    }
    addCmd();
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:35,代码来源:LogViewerState.java


示例13: start

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
public void start () {
    messages = new Vector<String>();

    //#style networkTestForm
    interactiveView = new FramedForm(Localization.get("network.test.title"));
    exit = new Command(Localization.get("polish.command.ok"), Command.BACK, 0);
    back = new Command(Localization.get("polish.command.back"), Command.BACK, 0);
    details = new Command(Localization.get("network.test.details"), Command.SCREEN, 2);
    interactiveView.setCommandListener(this);
    interactiveView.addCommand(exit);

    //#style networkTestImage
    imageView = new ImageItem(null, null, ImageItem.LAYOUT_CENTER | ImageItem.LAYOUT_VCENTER, "");

    interactiveMessage = new StringItem(null, "");

    interactiveView.append(Graphics.TOP, imageView);
    interactiveView.append(interactiveMessage);

    J2MEDisplay.setView(interactiveView);

    final GPRSTestState parent = this;
    new HandledThread () {
        public void _run () {
            networkTest(parent);
        }
    }.start();
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:29,代码来源:GPRSTestState.java


示例14: addLine

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
public void addLine (String line) {
    Date now = new Date();
    if (start == null)
        start = now;

    int diff = (int)(now.getTime() - start.getTime()) / 10;
    String sDiff = (diff / 100) + "." + DateUtils.intPad(diff % 100, 2);

    view.append(new StringItem("", sDiff + ": " + line));
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:11,代码来源:PermissionsTestState.java


示例15: showResults

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
private void showResults (Vector log) {
    String[] lines = new String[log.size()];
    for (int i = 0; i < lines.length; i++) {
        lines[i] = (String)log.elementAt(i);
    }

    Form f = new Form("Test Result");

    for (int i = 0; i < lines.length; i++) {
        f.append(new StringItem(null, lines[i]));
    }

    Display.getDisplay(this).setCurrent(f);
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:15,代码来源:RMSTestMidlet.java


示例16: LoginView

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
/**
 * Create a LoginView.
 * 
 * @param loginListener Listener to signal of login events
 * @param backListener Listener to signal of back button presses
 */
public LoginView(LoginListener loginListener, BackCommandListener backListener) {
    super("Login", new Item[] {});

    this.backListener = backListener;
    this.loginListener = loginListener;
    this.username = new TextField("Username", session.getUsername(), 20, TextField.NON_PREDICTIVE & ~TextField.INITIAL_CAPS_WORD);
    this.password = new TextField("Password", null, 40, TextField.PASSWORD);
    this.submit = new StringItem(null, "Submit", StringItem.BUTTON);
    submit.setDefaultCommand(submitCommand);
    submit.setItemCommandListener(this);

    setupCommands();
}
 
开发者ID:mozilla,项目名称:pluotsorbet,代码行数:20,代码来源:LoginView.java


示例17: startApp

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
	this.recordButton = new StringItem(null, "Start", Item.BUTTON);
	Command toggleRecordingCMD = new Command("Click", Command.ITEM, 1);
	this.recordButton.addCommand(toggleRecordingCMD);
	this.recordButton.setDefaultCommand(toggleRecordingCMD);
	this.recordButton.setItemCommandListener(this);

	this.form = new Form(null, new Item[] {
			new StringItem(null, "Audio Recorder"), this.recordButton });

	this.display = Display.getDisplay(this);
	this.display.setCurrent(this.form);
}
 
开发者ID:mozilla,项目名称:pluotsorbet,代码行数:14,代码来源:AudioRecorder.java


示例18: AboutForm

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
public AboutForm(RadioMIDlet midlet) {
    super("About this app");

    this.midlet = midlet;

    append(new StringItem("Name", midlet.getAppProperty("MIDlet-Name")));
    append(new StringItem("Version", midlet.getAppProperty("MIDlet-Version")));
    append(new StringItem("Autor", midlet.getAppProperty("MIDlet-Vendor")));

    addCommand(BACK);
    setCommandListener(this);
}
 
开发者ID:cli,项目名称:rdio,代码行数:13,代码来源:AboutForm.java


示例19: RadioPlayerView

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
public RadioPlayerView(int stationIdx, RadioMIDlet midlet) {
    super(Stations.NAMES[stationIdx]);

    this.midlet = midlet;
    append(new StringItem(null, Stations.DESCRIPTIONS[stationIdx]));
    append(new Spacer(getWidth(), 5));
    append(new StringItem("Status", "Starting..."));

    addCommand(cmdBack);
    setCommandListener(this);
}
 
开发者ID:cli,项目名称:rdio,代码行数:12,代码来源:RadioPlayerView.java


示例20: commandAction

import javax.microedition.lcdui.StringItem; //导入依赖的package包/类
public void commandAction(Command c, Displayable d) {
	if (d == this) {
		if (c == DisplayableUnderTests.backCommand) {
			Manager.midletInstance.showMainPage();
		} if (c == addCommand) {
			append(new StringItem("si:", "StringItem" + Manager.sequenceNext()));
		}
	}
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:10,代码来源:ItemsOnForm.java



注:本文中的javax.microedition.lcdui.StringItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LineNumberTable类代码示例发布时间:2022-05-22
下一篇:
Java BoundedOutOfOrdernessTimestampExtractor类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap