I think this is the only way to do that.Every sub control has the "right" to process the key when it has the focus even if it does not process it. But it won't pass the key to the outside world because it's "selfish".

解决方案 »

  1.   

    Frame不也是Component吗?为什么处理不了事件呢?
      

  2.   

    Frame不也是Component吗?为什么处理不了事件呢?===>Frame能处理事件,但问题是事件并没有被Frame截获. 比如Frame上有一个TextField,你想在TextField中输入,你说应该是Frame收到事件好呢还是TextField收到事件好呢?
      

  3.   

    To helpall:
    Java里的Key消息是如何传递的啊?感觉好像和VC不太一样?也有一个传递的顺序吗?
    我试了一下Java的消息处理好像和焦点有关,是这样的吗?
    如果是的话当我焦点没停在任何Frame的子控件上消息为什么不是让Frame接受呢?