窗口800*700的
面板是3200*2400的一张地图
我想实现的效果就是跟魔兽里的一样
当鼠标到达窗口边缘的时候   地图就开始移动
大家提点好意见  

解决方案 »

  1.   

    懂A*算法的可以加我QQ942555939   谢谢了!
      

  2.   

    鼠标就不可能不在图片范围
    窗口才800*700
    里面一个PANEL 3200*2400  是一个地图
    我怎么取鼠标的也取不到当前窗口的坐标都是PANEL的坐标
      

  3.   


    SwingUtilities 提供的工具方法:
    static Point convertPoint(Component source, int x, int y, Component destination) 
              将 source 坐标系统中的点 (x,y) 转换到 destination 坐标系统。 
    static Point convertPoint(Component source, Point aPoint, Component destination) 
              将 source 坐标系统中的 aPoint 转换到 destination 坐标系统。 
    static void convertPointFromScreen(Point p, Component c) 
              将一个点从屏幕坐标转换到组件的坐标系统 
    static void convertPointToScreen(Point p, Component c) 
              将一个点从组件的坐标系统转换到屏幕坐标。 
    static Rectangle convertRectangle(Component source, Rectangle aRectangle, Component destination) 
              将 source 坐标系统中的矩形 aRectangle 转换到 destination 坐标系统。 
      

  4.   

    有没有方法:
    将 source 坐标系统中的矩形 aRectangle 转换到 destination 坐标系统的指定位置?