- 浏览: 2094978 次
- 性别:
- 来自: 广州
文章分类
最新评论
-
ratlsun:
想请教下uc最新版本在android4.2和4.3版本上是不是 ...
UC浏览器8.3 (for iPhone)设计理念.“無”为而设 -
gly0920sky520123:
很有用哦,谢谢
DOS命令大全(经典收藏) -
chenyu0748:
UC加油,花哥加油~
UC浏览器8.3 (for iPhone)设计理念.“無”为而设 -
cnliuyix:
LZ搞点更有层次的吧,介个一般工程里根本用不到这么简单的。Si ...
Android 设计一个可单选,多选的Demo -
gang4415:
rgz03407@163.com
JSR规范,系统参数测试大全
Overview
One of the Displayables in LCDUI is TextBox (extending Screen class), which allows user to enter and edit text. It is commonly used for entering relatively short texts, even single words. In any case TextBox has used the whole screen, which has made user experience bad. Now in S60 5th Edition new mode of pop-up TextBox is introduced. By using a JAD attribute "Nokia-UI-Enhancement" with value "PopUpTextBox" all the TextBox screens are shown as smaller dialogs, without obscuring the underlying screen.
Nokia-UI-Enhancement: PopUpTextBox
Pop-up TextBox does lack have some properties of "traditional" TextBox:
Ticker is not visible
Text input capacity indicator is not supported
An empty Pop-up TextBox has one line, but if needed, its size will grow. The exact maximum amount of visible lines depends on the screen size. In nHD screens (640x360 pixels) it is 5 rows of text. Inputting and editing text is possible by tapping on the TextBox.
The image below shows an empty pop-up TextBox on top of Canvas (in normal mode) and a pop-up TextBox with 5 rows of text
Here is a simple MIDlet demonstrating pop-up TextBox feature.
[edit]
Source code: PopUpTextBoxMIDlet.java
import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
public class PopUpTextBoxMIDlet extends MIDlet {
private PopUpTextBoxCanvas canvas;
protected String canvasText = "Text from the TextBox";
public void startApp() {
canvas = new PopUpTextBoxCanvas(this);
Display.getDisplay(this).setCurrent(canvas);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
protected void closeTextBox(boolean update) {
if (update) canvasText = canvas.textbox.getString();
if (canvas.textbox != null) canvas.textbox = null;
Display.getDisplay(this).setCurrent(canvas);
}
protected void showError(String title, String text) {
Alert alert = new Alert(title, text, null, AlertType.ERROR);
alert.setTimeout(Alert.FOREVER);
alert.getType().playSound(Display.getDisplay(this));
Displayable current = Display.getDisplay(this).getCurrent();
if (current instanceof Alert) {}
else Display.getDisplay(this).setCurrent(alert);
}
}
[edit]
Source code: PopUpTextBox.java
import javax.microedition.lcdui.*;
public class PopUpTextBox extends TextBox implements CommandListener {
private Command okCommand;
private Command cancelCommand;
private PopUpTextBoxMIDlet midlet;
public PopUpTextBox(String title, String text, int maxsize, int constraints, PopUpTextBoxMIDlet midlet) {
super(title, text, maxsize, constraints);
this.midlet = midlet;
okCommand = new Command("Ok", Command.OK, 1);
cancelCommand = new Command("Cancel", Command.CANCEL, 1);
this.addCommand(okCommand);
this.addCommand(cancelCommand);
this.setCommandListener(this);
}
public void commandAction(Command c, Displayable d) {
if (c == okCommand) {
midlet.closeTextBox(true);
}
if (c == cancelCommand) {
midlet.closeTextBox(false);
}
}
}
[edit]
Source code: PopUpTextBoxCanvas.java
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.TextField;
public class PopUpTextBoxCanvas extends Canvas implements CommandListener {
private PopUpTextBoxMIDlet midlet;
private Command enterCommand;
private Command exitCommand;
protected PopUpTextBox textbox;
private int width;
private int height;
public PopUpTextBoxCanvas(PopUpTextBoxMIDlet midlet) {
this.midlet = midlet;
enterCommand = new Command("Enter text", Command.SCREEN, 1);
exitCommand = new Command("Exit", Command.EXIT, 1);
this.addCommand(enterCommand);
this.addCommand(exitCommand);
this.setCommandListener(this);
}
public void paint(Graphics g) {
g.setColor(255, 255,255);
g.fillRect(0, 0, width, height);
g.setColor(0, 0, 0);
g.drawString(midlet.canvasText, 0, 0, Graphics.TOP|Graphics.LEFT);
}
protected void keyPressed(int keyCode) { }
protected void keyReleased(int keyCode) { }
protected void keyRepeated(int keyCode) { }
protected void pointerDragged(int x, int y) { }
protected void pointerPressed(int x, int y) { }
protected void pointerReleased(int x, int y) { }
protected void sizeChanged(int w, int h) {
width = w;
height = h;
repaint();
}
public void commandAction(Command c, Displayable d) {
if (c == enterCommand) {
textbox = new PopUpTextBox("Enter text", midlet.canvasText, 1000, TextField.ANY, midlet);
Display.getDisplay(midlet).setCurrent(textbox);
}
if (c == exitCommand) {
midlet.notifyDestroyed();
}
}
}
download http://www.forum.nokia.com/piazza/wiki/images/b/b3/PopUpTextBoxMIDlet.zip
发表评论
-
汉字点阵字库原理
2011-01-28 10:09 3328一、 汉字编码 1. ... -
如何通过改jad和Manifest把其它手机的java游戏改成N830的
2011-01-25 10:21 1318首先要明确一点,不是所有的游戏都能改的。 <200 ... -
索爱手机IMSI序列号获取
2011-01-20 11:29 1911国际移动用户识别码(I ... -
J2ME数组的复制及连接操作
2010-11-19 10:47 1219public class Arrays { /** ... -
手机 J2ME MIDP 性能测试工具(MIDP BenchMark)
2010-11-19 10:35 1410JavaME Test Suitehttp://www.dog ... -
SocketConnection 参数详细介绍
2010-03-23 11:34 2089请大家看下面的代码: len = is.read(gDat ... -
J2ME使用Socket通过cmwap接入点访问安全HTTPS
2010-03-17 16:36 484这个问题是在我升级J2ME版XHTML浏览器的时候被引入的 ... -
一些很特别的J2ME开源项目(转
2010-03-11 09:43 2304StrutsME 一个轻量级的序列化协议,使J2ME客户端能调 ... -
WMLC 检查charset编码
2009-12-16 15:27 180http://www.iana.org/assignments ... -
Eclipse快捷键
2009-12-01 10:38 1374编辑相关快捷键 Eclipse的编辑功能非常强大,掌 ... -
改善你的J2ME程序界面-使用开源UI库
2009-09-03 16:45 3648J2ME自带UI不是太美观,使用起来也不太方面,为了解决这 ... -
LZW数据压缩算法的原理分析【转】
2009-08-05 19:31 2528转一篇好文章, 原文地址:http://www.cnblog ... -
<a> 标签,target="blank",target="_blank" 的区别。
2009-05-27 13:00 11498在编写html代码的时候。 target="bla ... -
贡献 高效的MIDlet 编程
2009-05-23 15:32 1850从网上找到这本资料。 是E文版的。 大家顺便锻炼下E文 -
How to use freely resizable font in in Java ME
2009-05-23 13:41 1293Contents [hide] 1 Overview 2 ... -
A Simple Ordered Hashtable
2009-05-23 12:08 1516This article illustrates how to ... -
开发NokiaS40系列应用程序初级篇
2009-05-22 18:56 1686本文讲述如何搭建Nokia S40系列手机应用程序的开发环境 ... -
索尼爱立信手机在 J2ME 程序中的字体大小
2009-05-18 16:25 1292之前有朋友问到索尼爱立信手机在 J2me 程序中的字体大小,请 ... -
If-Modified-Since & If-None-Match
2009-05-13 11:01 14478google告诉网站站长:您 ... -
WAP 2.0介绍和使用规范
2009-05-08 16:09 11390—— XHTML MP and WCSS一、WAP的常识(省略 ...
相关推荐
This demonstrates how to create an auto-scrolling textbox.
精彩编程与编程技巧-突破 TextBox 32 K 的限制 ...
精彩编程与编程技巧-确定 TextBox 有几行 ...
精彩编程与编程技巧-屏蔽TextBox的系统菜单 ...
This program shows how to filter out characters from TextBox control.Uses GetWindowLong and SetWindowLong APIs.
这是我自己总结出来easyui-textbox和easyui-combobox的onchange事件响应实例,绝对可用,网上很多实例都无法运行,这个我亲自测试可用使用才传上来的,供大家参考学习。
easyui textbox失去焦点事件及获取文本框的内容easyui textbox失去焦点事件及获取文本框的内容easyui textbox失去焦点事件及获取文本框的内容
让TextBox的输入具备overwrite(覆盖)的功能
在 Textbox 中,录入 N 个字符后移到下栏
React包含文本框 调整文本和其他内容的大小以适合一个框。 只要在调整大小中使用em任何内容都可以包含! 安装 npm i react-contain-textbox 例子 ES6 import React , { ... < p> Buncha stuff to resize! <
精彩编程与编程技巧-TextBox 中英文输入方法切换 ...
基于easyui中的textbox输入框自定义的颜色选择器及源码
自己花了 一晚上搞出来的,没有找到合适的,最后自己根据观看博客的总结,做了此demo 下载运行即可
This activex librairy contain some frequently used object like:- formated textbox- numeric textbox- styled frame- toggle button- horizontal separator line with effect
JSF2.0实战 - 6、TextBox示例代码
精彩编程与编程技巧-TextBox的自动调节 ...
精彩编程与编程技巧-TextBox实现打印机效果 ...