connecting jframe to another jframe
Hello Everyone... i'm a newbie java programmer. I just want to ask for some help about this... can you give me examples of codes to connect one form to another form? example i have three button options (technician, admin, human resouce) to choose in the form1, if i click technician it will go to the log-in form of technician, then the frame1 with 3 buttons will be closed or hidden and so on and so forth... and if for example i click the wrong button there will be a "go back button" to go back to frame1.. thank you for any help you can extend to me... badly needed...
Re: connecting jframe to another jframe
Hmm, are you looking for CardLayout?
Re: connecting jframe to another jframe
you just create the forms in constructors.call the constructor in button click event. then you get what u expect.
for example, if you are creating employee details: employee personal info in one form, and payment details and designations in another form. if you want to go to payment details form from personal detail form by clicking one button with name "payment details".
you just write the following code in actionPerformed(ActionEvent ae )function :
if(ae.getActionCommand().equals("payment details")
{
payment p=new payment();
}
// payment is a constructor which is in file containing payment details. (Use Flow Layout).