Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By KevinWorkman

Thread: connecting two frames

  1. #1
    pardhu is offline Member
    Join Date
    Oct 2011
    Posts
    16
    Rep Power
    0

    Default connecting two frames

    how to connect two frames ?
    i.e., when an action occurs in one frame(e.g,when a button is pressed),another frame should be seen and the current frame disappears.
    i have a frame which contains a button named "login" and when it is pressed,another frame containing fields such as username and password should be seen
    how can i achieve this frame linking
    plz help me..........

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,879
    Rep Power
    8

    Default Re: connecting two frames

    Pretty sure this sounds like a job for CardLayout instead of multiple JFrames.

    But you would do it exactly how you use one JFrame. What have you tried? Where's your SSCCE demonstrating where you're stuck?
    Fubarable likes this.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: connecting two frames

    I agree with Kevin -- CardLayout sounds like the best solution. Otherwise if you absolutely need multiple windows, one should be the main window and should be a JFrame, the other should be a dialog window and should probably be a JDialog or its sibling, JOptionPane.

Similar Threads

  1. frames
    By giorgi in forum AWT / Swing
    Replies: 2
    Last Post: 05-04-2011, 08:45 PM
  2. setSize without frames
    By Javaer in forum New To Java
    Replies: 1
    Last Post: 01-09-2011, 02:41 AM
  3. jsp frames
    By vasug in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 04-16-2010, 05:00 PM
  4. panes, frames and ddm's :|
    By skatefreak in forum New To Java
    Replies: 1
    Last Post: 08-09-2009, 10:21 AM
  5. Help regarding Frames
    By ramesh.8189 in forum AWT / Swing
    Replies: 14
    Last Post: 02-15-2009, 08:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •