• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

graph

 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone say me how to draw a graph by getting x,y co-ordinates(not by calculating the co-ordinates) in applet with scrollpane.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's an example of how to dra an X/Y graph. It doesn't really make a difference whether it's in an applet, or part of a ScrollPane.
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that example the co-ordinates are being calculated..but my requirement is,i have to get both the co-ordinates and have to set tooltip which displays the value when pointing on that co-ordinate
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have to get both the co-ordinates


I don't understand what this means. From where are you getting the coordinates?

If you're talking of detecting where the mouse points to, then you need to add a MouseMotionListener. It supplies the code with MouseEvents, which have the X/Y information where the mouse is.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic