我想在canvas
里面使用mousePressed
。我怎样才能做到这一点?
public DragManager(Canvas canvas)
{
canvas.addMouseListener(new MouseAdapter() {
@Override public void mousePressed(MouseEvent e)
{
canvas.something(); // does not work.
}
});
}