Putting the content (code) for each tab into a different class
My application has a few tabs. It's getting hectic having the code for all tabs in a single class. So I decided to move the code for each tab into a separate class.
So now I have a class that represents the main window.
I put the code for each tab into a new class which extends JPanel.
I was hoping that I could add the tabs to the tabbedPane in my main window class like this:
tabbedPane.add("first tab", new FirstTab());
tabbedPane.add("second tab", new SecondTab());
(Where FirstTab and SecondTab are the name of the classes that have the code for thaose tabs).
This approach isnt't working; the tabs get displayed but nothing gets displayed onto the tabs.
Any help would be appreciated
Re: Putting the content (code) for each tab into a different class
Should work! Can you show us an example? Are you sure that you have components added to the panels? :8):