Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: connecting jframe to another jframe

  1. #1
    Junior Member
    Join Date
    May 2011
    My Mood
    Thanked 0 Times in 0 Posts

    Default 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...

  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Washington, DC
    My Mood
    Thanked 636 Times in 540 Posts

    Default Re: connecting jframe to another jframe

    Hmm, are you looking for CardLayout?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    Feb 2011
    Thanked 0 Times in 0 Posts

    Thumbs up 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).

Similar Threads

  1. Pop-out box using a JFrame.
    By ShaunB in forum Java Theory & Questions
    Replies: 6
    Last Post: April 28th, 2011, 12:03 PM
  2. JFrame
    By M3ss1ah in forum AWT / Java Swing
    Replies: 3
    Last Post: February 23rd, 2011, 05:00 PM
  3. JFrame
    By M3ss1ah in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 23rd, 2011, 04:24 PM
  4. JFrame Edit
    By n00b123 in forum AWT / Java Swing
    Replies: 1
    Last Post: May 19th, 2010, 08:23 PM
  5. JFrame help
    By Uden in forum AWT / Java Swing
    Replies: 0
    Last Post: August 14th, 2009, 01:37 PM

Tags for this Thread