Results 1 to 5 of 5
  1. #1
    OxigEN. is offline Member
    Join Date
    Nov 2014
    Posts
    28
    Rep Power
    0

    Default How Do I Retrieve What the User Wrote in a Text Field?

    Title bassicly.

    I used to program in a language called PAWN where you bassicly attached what the user has wrote to variables.
    But in here, it seems alot more complicated for me, I guess because I am a beginner.
    I'd like to know what the user has wrote in a text field and when (e.g.) the user presses SEND or something like that it'd like check what he has wrote or return the same thing in a new window or something like that.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,143
    Rep Power
    15

    Default Re: How Do I Retrieve What the User Wrote in a Text Field?

    Take a look at the API: https://docs.oracle.com/javase/8/docs/api/

    Find the class you're looking for. In this case, probably JTextField or something similar.

    Does that class contain any methods that return the text of the component?

    See also: https://docs.oracle.com/javase/tutor...ents/text.html
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

  3. #3
    OxigEN. is offline Member
    Join Date
    Nov 2014
    Posts
    28
    Rep Power
    0

    Default Re: How Do I Retrieve What the User Wrote in a Text Field?

    Thanks @KevinWorkman, although I have done something else I saw in a video which bassicly uses activites I guess (Took me ages to what I actually wrote in that code - and still right now I am not sure I fully understand how I got it to work) but now it all works fine, appreciate the help.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    27

    Default Re: How Do I Retrieve What the User Wrote in a Text Field?

    Quote Originally Posted by KevinWorkman View Post
    <snip Swing stuff>
    Since this is Android it's more likely to be a TextView.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,143
    Rep Power
    15

    Default Re: How Do I Retrieve What the User Wrote in a Text Field?

    Quote Originally Posted by Tolls View Post
    Since this is Android it's more likely to be a TextView.
    Whoops, good call. Didn't see that this was the Android subforum.
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

Similar Threads

  1. Adding Text from button to text field.
    By Irish Rayray in forum AWT / Swing
    Replies: 3
    Last Post: 02-13-2013, 06:38 PM
  2. Using JAAS to retrieve Logged in AD user
    By ActionAnt in forum Advanced Java
    Replies: 0
    Last Post: 06-01-2012, 09:39 AM
  3. Retrieve Text From A Webpage
    By anthropamorphic in forum Networking
    Replies: 1
    Last Post: 10-13-2011, 06:27 AM
  4. How do I retrieve data based on user input?
    By tunali2 in forum New To Java
    Replies: 1
    Last Post: 04-03-2011, 02:40 PM
  5. Youtube API - retrieve video on user input
    By Jman85 in forum New To Java
    Replies: 4
    Last Post: 11-11-2010, 06:15 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
  •