| Author |
change pixel value to cell coordinate
|
alona ariel
Ranch Hand
Joined: Sep 09, 2008
Posts: 36
|
|
How can I change the pixel value to normall cell coordinate?
int xpos
int ypos
public void mouseClicked (MouseEvent me) {
xpos = me.getX();
ypos = me.getY();
}
public void paint(Graphics g)
{
g.drawString("("+xpos+","+ypos+")",xpos,ypos);
g.drawLine(xpos, ypos, x, y);
g.setColor(Color.blue);
g.drawString("("+xpos1+","+ypos1+")",xpos1,ypos1);
g.drawLine(xpos1, ypos1, x, y);
}
|
 |
Kevin Workman
Ranch Hand
Joined: Sep 28, 2010
Posts: 151
|
|
alona ariel wrote:How can I change the pixel value to normall cell coordinate?
Cell coordinate of what? A JTable? A grid you have come up with yourself? A List? A Tree?
|
 |
 |
|
|
subject: change pixel value to cell coordinate
|
|
|