本文整理汇总了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();
}
});
}
示例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;
}
示例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));
}
}
示例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));
}
}
示例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) {
}
}
});
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}