What the application should do, when the JButton is clicked, is loading in the JFrame (jFrameObject.add(new BooksPanel(), BorderLayout.CENTER)) the proper JPanel.
So, if I click the Books JButton in the JPanel, the JFrame should load the BooksPanel with a view of my books by title. If I click the Author JButton, the JFrame should load the Authors panel and so on.
I'm starting to think that the Buttons JPanel should not be a subclass but an object of the JFrame.
Campbell Ritchie wrote:I didn’t mean to get rid of the panels. I meant to get the Listeners out of the panels into other classes. Even though many books show abominations like extends JFrame implements ActionListener.
Campbell Ritchie wrote:I am looking at Horstmann and Cornell Core Java II (vol 1) at the moment. I have always found that book good.Do you know about the Bunkhouse?