老师,请问 状态栏里怎么显示 鼠标当前位置
谁能给出代码呀,,,,,,

解决方案 »

  1.   

    Listen to Mouse Move Event, you will have the coordinate of current mouse location. Then you just display the coordinate values.If you don't know how to listen to event, please study hard on Java Tutorial on Swing.
      

  2.   

    I think you are looking for this document. There is a sample code available for you to study.http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#caret
      

  3.   

    void CMyView::OnMouseMove(UINT nFlags, CPoint point) 
    {
    // TODO: Add your message handler code here and/or call default
    CString str;
    str.Format("x = %d,y = %d",point.x,point.y);
    ((CMainFrame*)GetParent()) ->m_wndStatusBar.SetWindowText(str);
    CView::OnMouseMove(nFlags, point);
    }