Eu estou aprendendo sobre Applet e fiz um código que mostra a coordenada do click, porém esse código não funciona em um JApplet...
alguém saberia o porquê?
Applet/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package pick;
import java.applet.Applet;
import java.awt.*;
/**
*
* @author Ton
*/
public class NewJApplet extends Applet {
Point P;
@Override
public void init()
{
P = new Point(100, 100);
}
public boolean mouseDown(Event evt, int x, int y){
P.x = x;
P.y = y;
repaint();
return true;
}
public void paint (Graphics g){
g.drawString("x:" + P.x + " y:" + P.y, P.x, P.y);
}
}
package pick;
import java.applet.Applet;
import java.awt.*;
import javax.swing.JApplet;
/**
*
* @author Ton
*/
public class NewJApplet extends JApplet {
Point P;
@Override
public void init()
{
P = new Point(100, 100);
}
public boolean mouseDown(Event evt, int x, int y){
P.x = x;
P.y = y;
repaint();
return true;
}
public void paint (Graphics g){
g.drawString("x:" + P.x + " y:" + P.y, P.x, P.y);
}
}
também gostaria de saber se tem alguma forma de debugar um applet percorrendo linha a linha
>.<"
obrigado desde já