• Post Reply Bookmark Topic Watch Topic
  • New Topic

BufferedImage drawstring method  RSS feed

 
Gino Giuliani
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I've got this class method:



This gets called when ever I want to create my Textbox object however what gets created is a purple box (i know that I have set the array elements to purple to begin with) however when I try to use the drawstring method to "draw a string" I get an image which looks like the gif below. I have changed the text size to various sizes but without success. The string is supposed to say "This is a test" but obviously it doesn't. I can't figure it out, please can someone help
textbox.gif
[Thumbnail for textbox.gif]
Text Box created from method
 
Stephan van Hulst
Saloon Keeper
Posts: 7973
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, Game.getG() looks very suspicious. Where is Game getting the Graphics object from? Keeping it around outside of whatever painting method is being called by the event thread is probably a bad idea.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!