title: Create a custom event in Java
body: <p>I want to do something like this in Java but I don't know the way:</p>
  
  <p>When event "object 1 say 'hello'" happens,
  then object 2 responds to that event by saying "hello".</p>
  
  <p>Can somebody give me a hint or sample code?</p>