I have a class that extends JFrame and I want to have another top level class that extends ActionListener to handle the events for this.
Is importing the ActionCommands via a static import the best way to do this?
From reading up a bit more it seems that the Action events are handled in the same class with inner classes. So point taken there.
One final question. Say I have a screen with with a JFrame which contains 3 JPanels.
Would I create this 3 JPanels in the same class as the JFrame(Every example I have looked at has it done this way) or in there own separate classes.
Could you give a reason as to why they are all in the same class?
Joined: Oct 13, 2005
You don't need private classes. I have written about this before, here, with links to other useful thread.