当前位置: 首页>>代码示例>>Java>>正文


Java Form类代码示例

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


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

示例1: AndroidFormUI

import javax.microedition.lcdui.Form; //导入依赖的package包/类
public AndroidFormUI(final MicroEmulatorActivity activity, Form form) {
	super(activity, form, true);
	
	activity.post(new Runnable() {
		public void run() {
			scrollView = new ScrollView(activity);
			((LinearLayout) AndroidFormUI.this.view).addView(scrollView);
			listView = new AndroidListView(activity, AndroidFormUI.this);
			listView.setOrientation(LinearLayout.VERTICAL);
			listView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT));
			scrollView.addView(listView);

			invalidate();
		}
	});		
}
 
开发者ID:Helltar,项目名称:AMPASIDE,代码行数:17,代码来源:AndroidFormUI.java

示例2: startApp

import javax.microedition.lcdui.Form; //导入依赖的package包/类
public void startApp() {
    if (isInitialized) {
        return;
    }
    
    form = new Form("Heart Diag Application");
    form.append(textFieldSampleUrl);
    form.append(stringItemStatus);
    signalItem.setPreferredSize(form.getWidth(), form.getHeight() - textFieldSampleUrl.getPreferredHeight() - stringItemStatus.getPreferredHeight());
    form.append(signalItem);
    form.addCommand(exitCommand);
    form.addCommand(chooseCommand);
    form.addCommand(drawCommand);
    form.setCommandListener(this);
    Display.getDisplay(this).setCurrent(form);
    alert.addCommand(new Command("Back", Command.SCREEN, 1));
    isInitialized = true;
}
 
开发者ID:kamcpp,项目名称:heart-diag-app,代码行数:19,代码来源:HeartDiagAppMidlet.java

示例3: VoteItem

import javax.microedition.lcdui.Form; //导入依赖的package包/类
/**
 * Create a VoteItem.
 *
 * @param item Item we're voting on
 * @param preferredWidth Preferred width
 * @param listener Listener to signal of vote results
 * @param form parent BaseFormView
 */
public VoteItem(Voteable item, int preferredWidth, VoteListener listener,
    Form form, BaseFormView parent) {
    super(form, preferredWidth, null);

    this.item = item;
    this.parent = parent;
    this.voteImageWidth = voteDownImage.getWidth();
    this.voteImageHeight = voteDownImage.getHeight();
    this.height = getPrefContentHeight(width);
    this.listener = listener != null ? listener : new VoteListener() {

        public void voteSubmitted(int vote) {
        }
    };
    this.centerX = width / 2;

    if (TouchChecker.DIRECT_TOUCH_SUPPORTED) {
        LCDUIUtil.setObjectTrait(this, "nokia.ui.s40.item.direct_touch",
            new Boolean(true));
    }
}
 
开发者ID:mozilla,项目名称:pluotsorbet,代码行数:30,代码来源:VoteItem.java

示例4: CommentItem

import javax.microedition.lcdui.Form; //导入依赖的package包/类
/**
 * Create a CommentItem.
 * 
 * @param comment CommentThing represented by this item
 * @param listener Listener to signal of selections
 * @param preferredWidth Preferred width
 * @param form Parent form of this CommentItem
 */
public CommentItem(CommentThing comment, CommentSelectionListener listener,
    int preferredWidth, Form form) {
    super(form, preferredWidth, null);

    this.comment = comment;
    this.preferredWidth = preferredWidth;
    this.listener = listener;

    int level = comment.getLevel();
    this.xIndent = level == 0 ? 0 : Math.max(0, 12 * level) - (5 * (level
        - 1));
    this.bodyLines = getBodyLines();
    this.height = getPrefContentHeight(preferredWidth);
    this.metaText = comment.getCreated() == null ? "" : DatePrettyPrinter.
        prettyPrint(comment.getCreated()) + comment.getFormattedScore();

    if (TouchChecker.DIRECT_TOUCH_SUPPORTED) {
        LCDUIUtil.setObjectTrait(this, "nokia.ui.s40.item.direct_touch",
            new Boolean(true));
    }
}
 
开发者ID:mozilla,项目名称:pluotsorbet,代码行数:30,代码来源:CommentItem.java

示例5: Midlet

import javax.microedition.lcdui.Form; //导入依赖的package包/类
public Midlet() {
        form = new Form("Hello World");
        form.append("Hello Micro World");
        quit = new Command("Quit", Command.EXIT, 1);
        Command lala = new Command("Flee", Command.BACK, 2);
//        form.addCommand(lala);
        form.addCommand(quit);
        form.addCommand(lala);
        form.setCommandListener(new CommandListener() {

            public void commandAction(Command c, Displayable d) {
                try {
                    if (c == quit) {
                        destroyApp(true);
                        notifyDestroyed();
                    }
                } catch (Exception e) {

                }
            }
        });
    }
 
开发者ID:angelbirth,项目名称:gameloft,代码行数:23,代码来源:Midlet.java

示例6: SubmitForm

import javax.microedition.lcdui.Form; //导入依赖的package包/类
/**
 * Constructor ErrorPrompt. 
 *
 * @param  parent  ...
 */
public SubmitForm(MIDlet parent, LSClient client, ErrorPrompt errorPrompt) {
    this.errorPrompt = errorPrompt; 
    this.client = client;
    
    messageListener = new SentListener();
    
    close = new Command("Back", Command.STOP, 2);
    send = new Command("Send", Command.OK, 1);
    
    sendForm = new Form("RoundTrip Form");
    
    text = new TextField("Write message","",100,TextField.ANY);
    sendForm.append(text);

    field = new ChoiceGroup("Select Item",Choice.EXCLUSIVE,new String[]{"1","2","3","4","5"},null);
    sendForm.append(field);
    
    sendForm.addCommand(close);
    sendForm.addCommand(send);
    

    sendForm.setCommandListener(this);
    midlet = parent;
    reset();
}
 
开发者ID:Lightstreamer,项目名称:Lightstreamer-example-StockList-client-midlet,代码行数:31,代码来源:SubmitForm.java

示例7: ErrorPrompt

import javax.microedition.lcdui.Form; //导入依赖的package包/类
/**
 * Constructor ErrorPrompt. 
 *
 * @param  parent  ...
 */
public ErrorPrompt(MIDlet parent) {
    close = new Command("Back", Command.STOP, 2);
    clear = new Command("Clear", Command.OK, 1);
    changeLimit = new Command("Disable/Enable log limit", Command.OK, 1);

    errorForm = new Form("Error Form");

    errorForm.addCommand(close);
    errorForm.addCommand(clear);
    errorForm.addCommand(changeLimit);

    errorForm.setCommandListener(this);
    midlet = parent;
    reset();
}
 
开发者ID:Lightstreamer,项目名称:Lightstreamer-example-StockList-client-midlet,代码行数:21,代码来源:ErrorPrompt.java

示例8: startApp

import javax.microedition.lcdui.Form; //导入依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
	// TODO Auto-generated method stub
	display=Display.getDisplay(this);
	list.append("����Ϸ", null);
	list.append("�������", null);
	list.append("��Ϸ˵��", null);
	list.addCommand(cmd_ok);
	list.addCommand(cmd_back);
	list.setCommandListener(this);
	display.setCurrent(list);
	predisplay=display.getCurrent();	//��ʼ��ǰһ����ʾ
	form=new Form("");
	form.addCommand(cmd_back);
	form.addCommand(cmd_ok);
}
 
开发者ID:cabbage89,项目名称:danceGame,代码行数:16,代码来源:Main.java

示例9: startApp

import javax.microedition.lcdui.Form; //导入依赖的package包/类
public void startApp() {
    if (isInitialized) {
        return;
    }
    form = new Form("Heart Diag Application");
    form.append(textFieldSampleUrl);
    form.append(stringItemStatus);
    form.addCommand(exitCommand);
    form.addCommand(chooseCommand);
    form.setCommandListener(this);
    Display.getDisplay(this).setCurrent(form);
    alert.addCommand(new Command("Back", Command.SCREEN, 1));
    isInitialized = true;
}
 
开发者ID:kamcpp,项目名称:heart-diag-app,代码行数:15,代码来源:HeartDiagAppMidlet.java

示例10: showDetails

import javax.microedition.lcdui.Form; //导入依赖的package包/类
private void showDetails() {
    Form details = new Form(Localization.get("network.test.details.title"));
    for(String s: messages) {
        details.append(s);
    }
    details.addCommand(back);
    details.setCommandListener(this);
    J2MEDisplay.setView(details);
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:10,代码来源:GPRSTestState.java

示例11: start

import javax.microedition.lcdui.Form; //导入依赖的package包/类
public void start () {
    view = new Form("Permissions test");
    exit = new Command("OK", Command.BACK, 0);
    view.setCommandListener(this);
    view.addCommand(exit);
    J2MEDisplay.setView(view);

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

示例12: showResults

import javax.microedition.lcdui.Form; //导入依赖的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

示例13: clientThread

import javax.microedition.lcdui.Form; //导入依赖的package包/类
clientThread (Form currentForm, MIDlet currentMIDlet,String nodeName, String preferredNetwork,TheService service){
    this.currentMIDlet=currentMIDlet;
    this.currentForm=currentForm;
    this.nodeName=nodeName;
    this.preferredNetwork=preferredNetwork;
    this.service=service;
}
 
开发者ID:meisamhe,项目名称:GPLshared,代码行数:8,代码来源:clientThread.java

示例14: Registry

import javax.microedition.lcdui.Form; //导入依赖的package包/类
public Registry(String nodeName, String preferredNetowork, Form currentForm, MIDlet currentMIDlet){
    this.preferredNetwork=preferredNetowork;
    this.nodeName= nodeName;
    this.currentMIDlet=currentMIDlet;
    this.currentForm=currentForm;
    framework = FrameworkFrontEnd.getInstance(this);
}
 
开发者ID:meisamhe,项目名称:GPLshared,代码行数:8,代码来源:Registry.java

示例15: MatrixMultiplicationClientThread

import javax.microedition.lcdui.Form; //导入依赖的package包/类
MatrixMultiplicationClientThread (Form currentForm, MIDlet currentMIDlet,String nodeName, String preferredNetwork,MatrixMultiplication service){
    this.currentMIDlet=currentMIDlet;
    this.currentForm=currentForm;
    this.nodeName=nodeName;
    this.preferredNetwork=preferredNetwork;
    this.service=service;
}
 
开发者ID:meisamhe,项目名称:GPLshared,代码行数:8,代码来源:MatrixMultiplicationClientThread.java


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