Results 1 to 5 of 5
  1. #1
    sandeep43 is offline Member
    Join Date
    May 2011
    Posts
    97
    Rep Power
    0

    Question how to pass values between two JFrames?

    Hi,

    i have userid, password, connection_string variables in 1st JFrame, i want to pass same variables with data what was entered in 1st frame to second frame also.

    why? because user will enter these string once only, not every time.

    Regards
    Sandeep

  2. #2
    sandeep43 is offline Member
    Join Date
    May 2011
    Posts
    97
    Rep Power
    0

    Default

    tat is i want to share data between two frames which are present in same project.

    Regards
    Sandep

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,789
    Rep Power
    25

    Default

    Add some methods to one class that get/set the variables.
    Get a reference to the class and use those methods to share the data.

  4. #4
    sandeep43 is offline Member
    Join Date
    May 2011
    Posts
    97
    Rep Power
    0

    Default

    Hi Norm,

    Thanks for replying, how can i accomplish this under an actionperformed event?? rather than calling under a class, because i am developing Swing application so those operations performed under an actionperformed event is more appropriate i feel.


    Regards
    Sandeep

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,789
    Rep Power
    25

    Default

    The same principle applies. Get a reference to the other class and call some method.

Similar Threads

  1. How to pass values from frames..
    By kryptonian03 in forum AWT / Swing
    Replies: 2
    Last Post: 05-06-2011, 10:28 PM
  2. how to pass values from jsp to servlet
    By jksathya in forum Eclipse
    Replies: 1
    Last Post: 02-01-2011, 10:13 AM
  3. Replies: 14
    Last Post: 01-22-2011, 03:36 PM
  4. Pass Values into 2D Array?
    By noble in forum New To Java
    Replies: 7
    Last Post: 11-09-2010, 08:30 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
  •