当前位置:编程学习 > JAVA >>

J2ME触屏输入问题与wtk触屏模拟器问题

请问触屏的手机在高级用户界面中向添加在Form 中的TextField输入信息,J2ME有什么方法,有没有例如调出一个虚拟键盘什么的,谢谢
还有一个问题,在网上看wtk有触屏模拟器,只需C:\WTK25\wtklib\devices\DefaultColorPhone touch_screen=false中的false改成true就行,但我改后还是不能模拟触屏,用的确实是DefaultColorPhone模拟器,请问该如何操作才能触屏模拟 --------------------编程问答-------------------- 那个虚拟键盘是没有的吧。那些可能都是操作系统自己的,一般虚拟机不代吧。

你这样改还不行我就不知道了。一般情况下这样改就能支持了。改后你虚拟机上的指针会变成十字型。你实现那些方法了吗? --------------------编程问答-------------------- 特意从网上找一个触屏的程序,可还是不能模拟,鼠标指针变不了十字 --------------------编程问答-------------------- 涉及到文本输入的多数是由系统决定的,有的触屏手机需要输入text时会自动调出虚拟键盘 --------------------编程问答-------------------- 高级界面的具体实现由厂商自己负责,无法自定义输入方式
第二个问题,你确认你修改后保存了么? --------------------编程问答-------------------- C:\WTK2.5.2\wtklib\devices\DefaultColorPhone
用记事本打开后
## files that are necessary for the emulator to start: ##
## they are located at the same directory as this properties file

default_image=DefaultColorPhoneNormal.png
pressed_buttons_image=DefaultColorPhonePressed.png
highlighted_image=DefaultColorPhoneHiLite.png

## version and configuration properties
version.profile=MIDP-2.1
version.configuration=CLDC-1.1

## screen properties ##

# Screen location, relative to the top-left corner of the
# telephone's image
###############
screen.x=37
screen.y=54

# Screen size in pixels
###############
screen.width=240
screen.height=320

# The region of the screen available to graphics commands
# This section is optional. It defines the drawable region
# of the screen to be a subregion of the whole screen area.
###############
screenPaintableRegion.x=0
screenPaintableRegion.y=10
screenPaintableRegion.width=240
screenPaintableRegion.height=292

# pixel size ratio (shape of each pixel).
# example: 1x1=square pixel, 1x2=rectangular pixel
###############
screenPixelRatio.x = 1
screenPixelRatio.y = 1

# Touchscreen support
###############
touch_screen=true # Screen Background RGB Color
# examples: 0xffffff = white, 0x000000 = black
###############

        #       Screen border RGB color is a color of softbuttons and icons 
        #       area. If not defined, screen background color is used
        #       example: screenBorderColor = 0xf0f0f
        ###############
screenBorderColor=0xb6b6aa

        #       Transparency support
        #       SRC_OVER alpha composition rule
        #       supported by default
        ###############
enableAlphaChannel=true

netindicator.image: netIndicatorOn.png
netindicator.bounds: 36, 23, 14, 14

button.1 = 36, 493, 76, 31
button.2 = 119, 493, 76, 31
button.3 = 203, 493, 76, 31
button.4 = 36, 527, 76, 31
button.5 = 119, 527, 76, 31
button.6 = 203, 527, 76, 31
button.7 = 36, 561, 76, 31
button.8 = 119, 561, 76, 31
button.9 = 203, 561, 76, 31
button.ASTERISK = 36, 595, 76, 31
button.0 = 119, 595, 76, 31
button.POUND = 203, 595, 76, 31

button.SOFT1 = 36, 394, 76, 24
button.SOFT2 = 203, 394, 76, 24
button.SEND = 36, 421, 76, 24
button.END = 203, 421, 76, 24
button.HOME = 36, 448, 76, 24
button.CLEAR = 203, 448, 76, 24
button.POWER = 262, 19, 20, 20
button.LEFT = 118, 411, 16, 43
button.RIGHT = 182, 411, 15, 43
button.UP = 135, 394, 43, 14
button.DOWN = 135, 459, 43, 14
button.SELECT = 136, 412, 42, 44

command.keys.BACK = SOFT1
command.keys.EXIT = SOFT1
command.keys.CANCEL = SOFT1
command.keys.STOP = SOFT1

command.keys.OK = SOFT2
command.keys.SCREEN = SOFT2
command.keys.ITEM = SOFT2
command.keys.HELP = SOFT2

command.exclusive.SOFT1 = BACK, EXIT, CANCEL, STOP

command.menu.activate = SOFT2

keyboard.handler = com.sun.kvem.midp.DefaultKeyboardHandler

key.0 = VK_0 VK_NUMPAD0
key.1 = VK_1 VK_NUMPAD1
key.2 = VK_2 VK_NUMPAD2
key.3 = VK_3 VK_NUMPAD3
key.4 = VK_4 VK_NUMPAD4
key.5 = VK_5 VK_NUMPAD5
key.6 = VK_6 VK_NUMPAD6
key.7 = VK_7 VK_NUMPAD7
key.8 = VK_8 VK_NUMPAD8
key.9 = VK_9 VK_NUMPAD9
key.POUND = VK_SUBTRACT
key.ASTERISK = VK_MULTIPLY
key.POWER = VK_ESCAPE
key.UP = VK_UP
key.DOWN = VK_DOWN
key.LEFT = VK_LEFT
key.RIGHT = VK_RIGHT
key.SELECT = VK_ENTER
key.SOFT1 = VK_F1
key.SOFT2 = VK_F2
key.SEND = VK_HOME
key.END = VK_END
key.CLEAR = VK_BACK_SPACE

midlet.SUSPEND_ALL = VK_F6
midlet.RESUME_ALL = VK_F7

# Support of Key Repeat Events
# keyRepeatEvents = false
#

# Multiple font support:
# font.<face>.<style>.<size>=<font properties file name> |
#                                                     <system font definition>
# Where
# <face> is one of
# system, monospace, proportional
#
# <style> is one of
# plain, bold, italic
#
# <size> is one of
# small, medium, large
#
# Default font is defined by
# font.default=<font properties file name> | <system font definition>
#
# Soft Button font defined by
# font.softButton=<font properties file name> | <system font definition>
#

font.default=SansSerif-plain-10
font.softButton=SansSerif-plain-11


font.system.plain.small: SansSerif-plain-9
font.system.plain.medium: SansSerif-plain-11
font.system.plain.large: SansSerif-plain-14

font.system.bold.small: SansSerif-bold-9
font.system.bold.medium: SansSerif-bold-11
font.system.bold.large: SansSerif-bold-14

font.system.italic.small: SansSerif-italic-9
font.system.italic.medium: SansSerif-italic-11
font.system.italic.large: SansSerif-italic-14

font.system.bold.italic.small: SansSerif-bolditalic-9
font.system.bold.italic.medium: SansSerif-bolditalic-11
font.system.bold.italic.large: SansSerif-bolditalic-14

font.monospace.plain.small: Monospaced-plain-9
font.monospace.plain.medium: Monospaced-plain-11
font.monospace.plain.large: Monospaced-plain-14

font.monospace.bold.small: Monospaced-bold-9
font.monospace.bold.medium: Monospaced-bold-11
font.monospace.bold.large: Monospaced-bold-14

font.monospace.italic.small: Monospaced-italic-9
font.monospace.italic.medium: Monospaced-italic-11
font.monospace.italic.large: Monospaced-italic-14

font.monospace.bold.italic.small: Monospaced-bolditalic-9
font.monospace.bold.italic.medium: Monospaced-bolditalic-11
font.monospace.bold.italic.large: Monospaced-bolditalic-14

font.proportional.plain.small: SansSerif-plain-9
font.proportional.plain.medium: SansSerif-plain-11
font.proportional.plain.large: SansSerif-plain-14

font.proportional.bold.small: SansSerif-bold-9
font.proportional.bold.medium: SansSerif-bold-11
font.proportional.bold.large: SansSerif-bold-14

font.proportional.italic.small: SansSerif-italic-9
font.proportional.italic.medium: SansSerif-italic-11
font.proportional.italic.large: SansSerif-italic-14

font.proportional.bold.italic.small: SansSerif-bolditalic-9
font.proportional.bold.italic.medium: SansSerif-bolditalic-11
font.proportional.bold.italic.large: SansSerif-bolditalic-14

# Font underlining :
#
# Font underlining is enabled by default. It is possible to disable font
# underlining with
#
# font.all.underline.enabled=false
#
# or per font with
#
# font.<face>.<style>.<size>.underline.enabled=false

# Multistate icons support:
#
# icon.<name> = <x location>,<y location>,<initial state>
# icon.<name>.<state #1> = <state #1 image file name>
# ..
# icon.<name>.<state #n> = <state #n image file name>

icon.up: 113, 306, off
icon.up.off:
icon.up.on: ../Share/up.gif

icon.down: 113, 314, off
icon.down.off:
icon.down.on: ../Share/down.gif

icon.left: 105, 308, off
icon.left.off:
icon.left.on: ../Share/left.gif

icon.right: 121, 308, off
icon.right.off:
icon.right.on: ../Share/right.gif

icon.internet: 64, 1, off
icon.internet.off:
icon.internet.on: ../Share/internet.gif

icon.reception: 2, 1, on
icon.reception.on: ../Share/reception.gif

icon.battery: 225, 2, on
icon.battery.on: ../Share/batt.gif

icon.inmode: 113, 2, off
icon.inmode.off:
icon.inmode.ABC: ../Share/ABC.gif
icon.inmode.abc: ../Share/abc_lower.gif
icon.inmode.123: ../Share/123.gif
icon.inmode.kana: ../Share/kana.gif
icon.inmode.hira: ../Share/hira.gif
icon.inmode.sym: ../Share/sym.gif

icon.domain: 210, 0, off
icon.domain.off:
icon.domain.trusted: ../Share/trusted.png

icon.shutter: 196, 0, off
icon.shutter.off:
icon.shutter.enable: ../Share/ShutterClosedState.png
icon.shutter.on: ../Share/ShutterOpenState.png

icon.flash: 180, 0, off
icon.flash.off:
icon.flash.no: ../Share/NoFlash.png
icon.flash.auto: ../Share/AutoFlash.png
icon.flash.autoRed: ../Share/AutoFlashRedReduction.png
icon.flash.force: ../Share/ForceFlash.png
icon.flash.forceRed: ../Share/ForceFlashRedReduction.png
icon.flash.reduced: ../Share/ReducedFlash.png

#
# Sound support:
# alert.<alert_type>.sound: <sound file>
# Where possible <alert_type> are
#
# alarm
# info
# warning
# error
# confirmation
#
# Default sound type is used for all alerts where specific sound is not
# defined:
# alert.default.sound: <sound file>

alert.alarm.sound:   ../Share/mid_alarm.wav
alert.info.sound:    ../Share/mid_info.wav
alert.warning.sound: ../Share/mid_warn.wav
alert.error.sound:   ../Share/mid_err.wav
alert.confirmation.sound: ../Share/mid_confirm.wav
vibrator.sound: ../Share/vibrate.wav

# Softbuttons support:
# softbutton.<number>=<x location>,<y location>,<width>,<height>,<font>
#
# Coordinates are relative to the origin of the screen area.

softbutton.0=1,306,78,16, softButton, left
softbutton.1=160,306,78,16, softButton, right

#
# Gamma value for gamma-correction
# Default value is 1, which means that no gamma-correction is actually performed
#
#gamma=2

# Color/Grayscale screen support:
colorCount=0x1000
isColor=true
alphaLevelCount=0x100

camera.src.file = viewFinder.mpg
已改为touch_screen=true保存后打开Eclipse运行含有触屏的程序,还是无法调出触屏的模拟器,我有哪个地方做的不对呀?请大家帮帮忙!谢谢!

--------------------编程问答-------------------- wtk的模拟器高级UI的触屏指针操作不支持,真机支持的 --------------------编程问答-------------------- 但我用的是Canvas,在别人的电脑上可以模拟出来,我的模拟器鼠标放到模拟器上就是不显示十字,而且程序也不运行,安装的应该没错,其他不是触屏的程序都能运行,烦死了~ --------------------编程问答-------------------- 我遇到一楼的问题 --------------------编程问答-------------------- 这个问题只要重装下WTK,并重新去设置下WTK安装目录下,打开对应的模拟器,touch_screen=true  就可以解决了 --------------------编程问答-------------------- 我也想加上触屏。。学习一下。 --------------------编程问答-------------------- mark --------------------编程问答-------------------- 应该是可以的 就是设置下 为true就行了 是在不行 就重新装下把 --------------------编程问答-------------------- --------------------编程问答-------------------- 直接用kemulator就是了,没必要用那个。 --------------------编程问答-------------------- 你修改的device改错了 --------------------编程问答-------------------- 看清楚你的device是DefaultColorPhone还是MediaControlSkin --------------------编程问答-------------------- colorCount=0x1000
·········改成colorCount=0x10000试一试······还有你确定你下载的那个模拟器的DefaultColorPhone.properties文件····就是你改的那个文件?? --------------------编程问答-------------------- 如果还不行·····你就加我QQ:121284619·····我给你发一个WTK程序安装包 --------------------编程问答-------------------- 1.你确定你用得模拟器是wtk2.5(如netbeans7.0默认是wtk3.0)
2.然后确定你改的跟你用的设备是一致的(都是DefaultColorPhone)
3.只要 ……\wtk_2_5_2\wtklib\devices\DefaultColorPhone目录下的 .properties文件的touch_screen 修改为true,基本上就不会出现你说的问题了。 --------------------编程问答-------------------- --------------------编程问答-------------------- 你修改了那个配置,应该模拟器是可以支持触屏了的.建议你重新晚装WTK。
J2ME平台的手机中,高级界面的具体实现一般是由具体硬件厂商自己负责决定的,J2ME程序员是无法自定义输入方式。说通俗点:用户选择文本框,触屏手机会弹出虚拟键盘,手机操作系统会显示优先级别最高输入法,至于J2ME程序员想弹出啥“自定义的键盘或是自定义的输入法”,这是没可能的。根本无法控制的。

Canvas属于低级界面,你可以根据不同触屏手机和按键手机,开发不同的版本。
在Canvas中,你可以自己虚拟出键盘来。
总而言之,不同的硬件厂商实现不同,是很头疼的事情。尤其是键盘布局,键盘码,功能键 那些... --------------------编程问答-------------------- 我最近也在为这个问题烦恼。很多人都是自己用低级界面开发的虚拟键盘/输入法
补充:Java ,  J2ME
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,