NetBeans: Set JPanel from another class.
807606Apr 18 2007 — edited Apr 19 2007New here, and reasonably new to Java, and been using NetBeans for about a week. What I'm looking to do is have one JFrame (created through NetBeans) that I can populate with JPanels created in different classes.
For example, I want to have a main window, and when a user selects a menu option, the screen repaints and displays the new panel.
I've created a JFrame with menubar called "Startpage" via the GUI Builder (the class contains nothing else but the NetBeans generated code).
Then, I've created a JPanel called "pnlSettings". What I want to do is by clicking the Settings menu option (which I've attached the actionlistener too) the pnlSettings JPanel will load in the Startpage JFrame. Eventually I will have about 20 different panels that will load when selected from the menubar.
Any help would be appreciated.
Thanks
-Blaise
BTW: Anybody else hate GUIs? The database was the easy part, and I can't figure out this, what I would imagine to be, easy question.