• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I want to use canvas to read input from key pad!

 
Habtamu Aboma
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to develope text predicting software using j2me,how can I use canvas to read input from mobile key?I face some problems to use text box and text field class.
thanks.
 
Shoumin Li
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You question not clear.
But I think in canvas class
there have some method to support key input
for example keypress(int key).
You can check the document of j2me
[ July 08, 2007: Message edited by: Shoumin Li ]
 
Habtamu Aboma
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry,my question is how can I use Canvas for editing text as an alternative to TextBox and TextField classes?Is there any way in which Canvas is used to develope applications similar to mobile applications for sending message like SMS?
Thanks!
 
Eduardo Marques
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no text widget provided by Canvas. What you can do is couple your character event handlers with echoing those characters by calling drawString() on the Graphics instance.


[ July 08, 2007: Message edited by: Eduardo Marques ]
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What would the Canvas-based widget do that the other text enrty widegets can't? What problems are you encountering using those?
 
Eduardo Marques
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Canvas can detect key-strokes but does not echo them as a TextField widget.
Thus my suggestion ... I don't think there's any other way if you really want to use Canvas.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic