Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

g.draw() working but g.drawString() is not  RSS feed

 
michael tall
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wanted to draw lines and text on canvas. When I execute the application I am seeing the lines but I am unable to see the text. Code is given here
Then I set size of GraphDisplay object as 480,480, added the object to contentPane of JFrame and executed the code. Unable to understand why the text is not drawn/visible.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> g2.drawString(df91.format(curX),(int)graduation,0);

you do realize that when you specify a 'y' of 0, that is the bottom of the drawString()

i.e. experiment with 'y' values of 30+
 
michael tall
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!