Sniperon1220
Sniperon1220

Reputation: 9

JtabbedPanes in Multiple classes using GUI Builder

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

Answers (1)

MadProgrammer
MadProgrammer

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

Panel based form

Add what ever content you need to it and build what ever functionality you need

Build it up

Create another JPanel based form and add a JTabbedPane to it...

Tabbed Pane

Make sure you save and compile your classes first and the drag you original panel based form onto the JTabbedPane...

Drag

You now have a new tab :)

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

Related Questions