Results 1 to 5 of 5

Thread: textarea

  1. #1
    ubuntu is offline Member
    Join Date
    May 2007
    Posts
    1
    Rep Power
    0

    Default textarea

    Hello!
    How can I limit the textarea?
    and how can I put it a scrollbar?

    thanks

  2. #2
    levent Guest

    Default

    What do you mean by "limit"?

    For putting a scrollbar around a textarea, you need to add a jscrollbar to your container (e.g. jpanel) and then add your jtextarea inside the jscrollbar .

  3. #3
    sandor is offline Member
    Join Date
    Apr 2007
    Location
    Pennsylvania,USA
    Posts
    45
    Rep Power
    0

    Default

    Could you put a listener on the textarea and then whenever there is a keysroke get the length of the data that is in there. If it is over the maximum length you want it to be, popup a little dialog saying that is all that can fit in.
    "You exceeded the maximum character limit of 50" or whatever.

  4. #4
    Alan is offline Member
    Join Date
    May 2007
    Posts
    39
    Rep Power
    0

    Default

    If you are using JTextArea you should use setWrapStyleWord(boolean word) and word=true

  5. #5
    orchid's Avatar
    orchid is offline Member
    Join Date
    Apr 2007
    Location
    Midwest
    Posts
    60
    Rep Power
    0

    Default

    I think there is something called a Mask Formatter you can use too to possibly restrict the amount of data allowed in. I did not check the API, just going on memory but look mask formatter up in the API and see if that does what you need.

Similar Threads

  1. TextArea with Unicode
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 04-16-2008, 11:53 PM
  2. How to get the position of character in TextArea
    By loganathan.lakshmanan in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 01-19-2008, 01:06 AM
  3. TextArea Bug?
    By Soda in forum New To Java
    Replies: 2
    Last Post: 12-07-2007, 01:37 PM
  4. Replies: 1
    Last Post: 08-07-2007, 06:35 AM
  5. problems when I print in textarea
    By gabriel in forum New To Java
    Replies: 1
    Last Post: 07-26-2007, 07:57 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
  •