How comes I see some classes that extend JFrame and implement ActionListener and than there are other that don't but are still able to produce the GUI?
Thanks
Printable View
How comes I see some classes that extend JFrame and implement ActionListener and than there are other that don't but are still able to produce the GUI?
Thanks
Because there is no requirement for a GUI class to either extend JFrame or implement ActionListener to use this functionality. If you need to display a GUI in a JFrame, then you can make the JFrame at the time it is needed. If you need to add an ActionListener to a JButton, then you can use an anonymous inner class or a separate external class that implements the interface.