如何在java中的Graphics2D对象上创建事件

时间:2014-02-07 15:15:00

标签: java image awt mouseevent graphics2d

请知道如何将自定义鼠标事件添加到graphics2D对象中?

image = ImageIO.read(map_file);
logo_maps = ImageIO.read(map_file_logo);
Graphics2D test;
test = image.createGraphics();

test.setColor(Color.red);
test.drawImage(logo_maps,l.getX(),l.getY(), 20, 20,this);
test.drawString(l.getLibelle(), l.getX(),l.getY());

1 个答案:

答案 0 :(得分:1)