boolean javax.swing.JComponent.contains(int x, int y)contains
public boolean contains(int x,
                        int y)这个contains(int x,int y)方法是做什么的?最好举个例子
                        

解决方案 »

  1.   

    没有用过swing,不过根据方法的名字,应该是判断一个点(x,y)是否在当前控件的覆盖范围之内
      

  2.   

    contains()方法用来确定鼠标事件的点击位置
      

  3.   

    contains(int x, int y) 用来判断该组件是否包含点(x,y)
      

  4.   

    Checks whether this component "contains" the specified point, where the point's x and y coordinates are defined to be relative to the coordinate system of this component.说得很清楚