I am doing a project where i want to display another frame when i click on it.
FOr eg. I have page named add customer record which has the button home, when i click on it it should display the home class ?
How can I do this ? Also am using netbeans GUI Builder so please consider that.
First you mentioned Netbeans GUI builder... don't use it for your own good. It's better to learn the Swing/AWT API through coding. To get started with Swing check out the Swing tutorial here.
As for your question, buttons have a thing called action/event listener, which you use it to control what that button do (eg new frame pop-up, enable/disable something, etc).
Of course before you get there, learn the basics first such as layout managers, the available components (JFrame, JButton, JLabel, JTable, JXXXX etc).
First you mentioned Netbeans GUI builder... don't use it for your own good. It's better to learn the Swing/AWT API through coding. To get started with Swing check out the Swing tutorial here.
As for your question, buttons have a thing called action/event listener, which you use it to control what that button do (eg new frame pop-up, enable/disable something, etc).
Of course before you get there, learn the basics first such as layout managers, the available components (JFrame, JButton, JLabel, JTable, JXXXX etc).
Always get the ones "Don't use the gui builder" "don't use IDEs they CHEAT!!!" Kawmon really.. Instead it should say "you should learn how to code the gui work, before going to the gui builder, as understanding the code behind it is the most important thing.... IF you get stuck without knowing what to do it's a bad bad thing."
I personally think the netbeans gui builder is one of the best tools out there... It's a lot better than Scene Builder >( I had to build 136 menu, sub menu, and sub sub menus, and with the gui builder took 6 hours.... Would have taken 10x that coding by hand. Why waste time and "be cool" hard coding things when there are tools to not only do it, but do it great?
As mentioned above you shouldn't have multiple Jframes as that is the top level. I would use JInternalFrames as suggested, or when customer records come in you should pop up a dialog to enter the customer data, then after clicking ok, sends you back to the home page.
Jay Orsaw wrote:Always get the ones "Don't use the gui builder" "don't use IDEs they CHEAT!!!" Kawmon really.. Instead it should say "you should learn how to code the gui work, before going to the gui builder, as understanding the code behind it is the most important thing...
That's what K. Tsang did say. To quote "It's better to learn the Swing/AWT API through coding".
Jay Orsaw wrote:Always get the ones "Don't use the gui builder" "don't use IDEs they CHEAT!!!" Kawmon really.. Instead it should say "you should learn how to code the gui work, before going to the gui builder, as understanding the code behind it is the most important thing...
That's what K. Tsang did say. To quote "It's better to learn the Swing/AWT API through coding".
Yes, I know, it's how he said it, and saying "don't use it for your own good," again, isn't the correct way to phrase it, to which I said above, use it while learning how the code works, and how to fully utilize the gui builder and netbeans itself.