• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to create a textfield in canvas

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello

can anybody tell me how to create a textfield in canvas??

thanks
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I belive that isnt possible, because, textfield can only be attached in form component..
Look for JME documentation to figure out more details
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes its not possible to use form and canvas components together ! According to me but there must be some other way out for it i guess.
 
Saloon Keeper
Posts: 27918
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Technically, you can't create a textfield in a canvas, but I think you can create a textfield overlay on a canvas. By which I mean that the 2 controls (textfield and canvas) occupy the same part of the screen (layout manager permitting), but the Z order of the textfield puts it in front of the canvas.

Just be careful when implementing the paint code so that the canvas does, in fact render behind the text control!
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, You can create textfield using Canvas, though its quite lengthy and difficult

1. Override the paint method
2. Draw rectangle and use the font to be used to type
3. Override keypressed event and check which key is pressed and repaint it.

These are just guideliness.
 
Vijay Dogra
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check this link

http://discussion.forum.nokia.com/forum/showthread.php?49518-textfield-on-canvas
 
reply
    Bookmark Topic Watch Topic
  • New Topic