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.


>> REGISTER NOW TO START POSTING


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

Results 1 to 2 of 2

Thread: About passing value from JFrame to other

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    5
    My Mood
    Cheerful
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy About passing value from JFrame to other

    Hello friends...i want to ask a question that how to pass a value of the textField from JFrame to other JFrame....Ex: As i want to display the name of the user on the WELCOME page by fetching the values of the username from the textField in the LOGIN JFrame..please help me !!!!! its urgent very urgent.. please help with a clear illustration....HELP!!!! HELP!!!!!


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: About passing value from JFrame to other

    To access data in one object from another object, you need a reference to the object with the data.
    The you can call a method in that object to get the data. For example:
    String someData = refToOtherObject.getData();

    where getData() is defined in the other class to return a String.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. problem with my JFrame; JFrame not closing and stay in background
    By golominator in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 6th, 2012, 08:20 AM
  2. passing arguments
    By Samaras in forum Java Theory & Questions
    Replies: 19
    Last Post: August 2nd, 2012, 05:47 AM
  3. using objects from one jFrame on a different jFrame
    By Taskeen in forum AWT / Java Swing
    Replies: 3
    Last Post: September 14th, 2011, 08:51 AM
  4. connecting jframe to another jframe
    By ajtambalo in forum Member Introductions
    Replies: 2
    Last Post: May 11th, 2011, 11:24 AM
  5. Passing a value to another class
    By Semple in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 4th, 2010, 05:49 PM

Tags for this Thread