In the example, a JTextField component is defined at the top of the window for the user to supply a URL. When the Return key is pressed, an ActionEvent is broadcast. The ActionListener object retrieves the user input and passes it to the JEditorPane object. [That object was set-up as a static data member because the anonymous ActionListener class defined in main() could not access a local object reference.] The JEditorPane component takes it from there.
[Reference: Topley, pp734,759-785]