How to linking from one frame to another frame?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Eric1987
    New Member
    • Feb 2009
    • 2

    How to linking from one frame to another frame?

    Hi,

    I am currently doing my java assignment. In this assignment, I had require to build a JFrame application.

    Component List in my application:
    1) Frame_A with a button
    2) Frame_b

    Application background:
    I have 2 frame, Frame_A and Frame_B. In the Frame_A, user can proceed to Frame_B if click on the button. In this manner, Frame_A will dissapear. You can imagine the login form as the example.

    Problem Statement:
    Problem obviously, I could not perform the linking between Frame_A and Frame_B. Currently, I only figure out using "Frame_A.setVis ible(false)" to perform the situation I want. But, I found out that it is more like open another frame (application) instead of continue proceed to Frame_B in the application.

    Therefore, is it any Java API to perform this kind of situation?

    So, I am here looking forward from you guyz help. Thanks in advanced!
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Either make frameA create a frameB when that button is pressed, or have a third class that creates both frames (frameA and frameB) and passed frameB to frameA (a simple method void passFrame(Frame B frameB) { ... } in your FrameA class can do the job.

    There a more scenarios, but those two came to mind first ...

    kind regards,

    Jos

    Comment

    • Eric1987
      New Member
      • Feb 2009
      • 2

      #3
      Originally posted by JosAH
      Either make frameA create a frameB when that button is pressed, or have a third class that creates both frames (frameA and frameB) and passed frameB to frameA (a simple method void passFrame(Frame B frameB) { ... } in your FrameA class can do the job.

      There a more scenarios, but those two came to mind first ...

      kind regards,

      Jos
      Hi JosAH,

      Thanks for reply.
      Yes, you give me the idea. But I want the FrameA proceed to FrameB within the same frame. It is because the way i mention avobe, it create a new frame (window) instead of continue proceed to next phase within the same frame.
      anyway, thanks for idea.


      Regards,
      Eric

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by Eric1987
        I want the FrameA proceed to FrameB within the same frame. It is because the way i mention avobe, it create a new frame (window) instead of continue proceed to next phase within the same frame.
        anyway, thanks for idea.
        I don't understand what you're trying to say here.

        kind regards,

        Jos

        Comment

        Working...