Results 1 to 6 of 6
  1. #1
    gubak is offline Member
    Join Date
    Nov 2010
    Posts
    3
    Rep Power
    0

    Default Sending string from one form to other - HOW?

    Hi!

    I have a desktop swing application with two jforms. The one is the main form with many textfields and the other form is for selecting some possible values for the main form.

    For example: I have a jtextfild in the main form for inserting address (adresses are predefined). these addresses can be selected in the second form. The second form activated for f7 function key and you can select address.

    My problem is how to send the selected adress (String) from the second form to the main form?

    Thanks!

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

  3. #3
    gubak is offline Member
    Join Date
    Nov 2010
    Posts
    3
    Rep Power
    0

    Default

    jform is a JFrame

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

    Default

    What you have is two JFrames then, one acting as a dialog. So I'll have to ask, why not just use a dialog instead such as a JOptionPane or a JDialog? This way you can choose for the dialog to be modal if desired (or not) as well as guarantee that the dialog window is always above the JFrame window.

    Now on to your problem, you transfer information from one GUI class to another same as as you would for any OOP program, often with getXXX and setXXX methods. The specifics will depend on your code of course.

    Luck!

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

    Default

    Oh, and welcome to the forum, by the way!

  6. #6
    gubak is offline Member
    Join Date
    Nov 2010
    Posts
    3
    Rep Power
    0

Similar Threads

  1. using a loop to form a string pattern
    By xquizitpinay in forum New To Java
    Replies: 7
    Last Post: 10-29-2010, 05:06 AM
  2. Sending a formatted string to a servlet
    By higashij in forum Java Servlet
    Replies: 0
    Last Post: 12-18-2009, 02:20 AM
  3. How to validate a string in the form E25/8938/2009
    By nmvictor in forum New To Java
    Replies: 8
    Last Post: 10-18-2009, 03:37 PM
  4. JSP sending a String to a "mini App" and calls that program too.
    By pikapika2501 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 06-25-2009, 12:19 PM
  5. Replies: 1
    Last Post: 01-11-2008, 11:06 PM

Posting Permissions

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