Reputation: 9
I am using netbeans GUI builder and im trying to figure out a way to have each pane in a different class. For example tab one and all its buttons and jazz will be in one class, and then tab two and all its buttons will be in a different class. If you know a way please let me know how.
Upvotes: 0
Views: 75
Reputation: 347334
Basically, any component based class which is in your projects class path (libraries, projects, jars, source code) can be added to the form editor (so long as it is compiled and can be instantiated without error)
Start by creating you a JPanel
based form/class
Add what ever content you need to it and build what ever functionality you need
Create another JPanel
based form and add a JTabbedPane
to it...
Make sure you save and compile your classes first and the drag you original panel based form onto the JTabbedPane
...
You now have a new tab :)
You can also do a lot of it by hand (fixing hand code with form editor code if you have to), have a look at Creating a GUI With JFC/Swing and How to Use Tabbed Panes for more details
Upvotes: 2