It's the mission of JVM, as a developer, you should not think about this. while, it's a good idea to learn the event response mechanism java -- it will lead you to observer design pattern...:)
To: feelyou(非鱼) 所以我想知道这种消息发送的机制,现在能在自己的组件中发送消息,可是不能上溯到相应应该响应该事件的子组件。 比如说:我在一个JFrame里自己生成了一个鼠标事件,按照该鼠标事件的坐标点,这个事件应该是JFram里的一个子组件响应,可是还是JFrame响应了这个鼠标事件。 请大虾们赐教:)
Try to use dispatchEvent()...
it is based on the Model-View-Controller (MVC) application architecture(especial Swing Component), which separates three distinct forms of functionality within the application:The Model represents the structure of the data in the application, as well as application-specific operation on data. The View accesses data from the model and specifies how that data should be presented. The Controller translates user actions on the model and selects the appropriate view based on user preferences.
e.getSource() get the sender and java transport event through the interface and the class's calling,end the last layer or being consumed
所以我想知道这种消息发送的机制,现在能在自己的组件中发送消息,可是不能上溯到相应应该响应该事件的子组件。
比如说:我在一个JFrame里自己生成了一个鼠标事件,按照该鼠标事件的坐标点,这个事件应该是JFram里的一个子组件响应,可是还是JFrame响应了这个鼠标事件。
请大虾们赐教:)
The View accesses data from the model and specifies how that data should be presented. The Controller translates user actions on the model and selects the appropriate view based on user preferences.
and java transport event through the interface and the class's calling,end the last layer or being consumed