This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • 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: 42970
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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!