Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想把这个图像放在地图上,所以我想要: - 单击一个按钮并制作一个新图像 - 用鼠标移动图像,单击时图像必须在 jpanel 上并且不再移动。
使用jpanel作为画布在某个位置绘制地图和图像。
监听鼠标移动事件,将图像位置更改为鼠标当前位置。重绘画布。
添加鼠标单击侦听器,当您单击时,禁用鼠标移动侦听器。