Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display Canvas and TextBox

 
Benjoe Reyes
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could both Canvas and Textbox exist or be displayed at the same time?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No they cannot. A textbox can only be placed in a Display, it is a direct subclass of Screen.
Another way to put it is Canvas uses Low-Level API's to draw, whereas the TextBox is a High-Level API.
You can always place text onto a Canvas using drawString() method of the Graphics object in your paint method.
Good Luck.
Mark
 
David Price
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually they can both exist at the same time, they just can't both be displayed at the same time. You choose which screen is displayed using Display's method setCurrent.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David, you know that is what I meant. and his question is about display not instantiated.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic