Results 1 to 7 of 7

Thread: Text Area help

  1. #1
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    175
    Rep Power
    2

    Default Text Area help

    Alright so I am making an applet that uses a text Area. I use this because I want it to say multiple lines my only question is how do i say what line it is on. currently i use this to set the text i use
    Java Code:
    textField.setText("whatever my string is");

  2. #2
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    175
    Rep Power
    2

    Default Re: Text Area help

    its AWT and i wanted to know how to change what line it appears on

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

    Default Re: Text Area help

    Sorry, I'm going to bow out on this as I am mainly familiar with Swing, not AWT. I suggest that if you don't have pressing reasons for using AWT you switch as well. Best of luck with solving this regardless!

  4. #4
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    175
    Rep Power
    2

    Default Re: Text Area help

    i use AWT becuase it is what i am most comftorable with and how would you do it in swing because alot of times its the same

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

    Default Re: Text Area help

    I'm still a little unclear as to your goal. Do you have a TextArea that has several lines of text in it, and now you want to change the ordering? Or is it something else entirely? Perhaps if you describe or even show your GUI and tell us what behavior you're trying to get the user to experience, we'll be better able to understand what you're striving for.

  6. #6
    Daryn is offline Senior Member
    Join Date
    Oct 2012
    Posts
    175
    Rep Power
    2

    Default Re: Text Area help

    What i want to happen is when i click a button a line of text appears
    and if the first line is filled with text then i want it to appear to the second line
    and if the second line is filled appear to the third line
    and so on and so on line

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

    Default Re: Text Area help

    OK, perhaps I have a better idea of what you're trying to do. Perhaps your algorithm could look something like this:

    in pseudocode
    Java Code:
    create a String variable called text, and fill it with the text currently held by the text area.
    Create a String that holds your new text, a new line, "\n", and the text String above.
    Replace the text in the text area with the new String created above.

Similar Threads

  1. adding text to a text area dynamically
    By tom2zip in forum AWT / Swing
    Replies: 3
    Last Post: 01-17-2012, 05:58 AM
  2. Replies: 8
    Last Post: 07-17-2011, 02:38 PM
  3. Text Area
    By pabloma2002 in forum CLDC and MIDP
    Replies: 1
    Last Post: 02-11-2011, 04:56 PM
  4. Replies: 0
    Last Post: 12-09-2010, 05:56 PM
  5. Replies: 0
    Last Post: 09-28-2010, 09:52 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
  •