Results 1 to 5 of 5
  1. #1
    aizen92 is offline Senior Member
    Join Date
    Nov 2010
    Posts
    155
    Rep Power
    11

    Default text field limit

    Hello,

    I am trying to make a JTextField and i want to limit it to 6 characters only, is it possible, i read the doc of the JTextField class but didnt find anything..., if there like a method to it, or should i implement one myself, or what can i do to limit it?

    Regards,

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    785
    Rep Power
    12

  3. #3
    aizen92 is offline Senior Member
    Join Date
    Nov 2010
    Posts
    155
    Rep Power
    11

    Default

    Thanks eRaaaa for the link, and it seems to be what i want, but it says this applys for the text pane is it the same as text field? is it okay for me to use it in text field?

  4. #4
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    785
    Rep Power
    12

    Default

    Yes. The JTextField document class is by default the PlainDocument which extends the AbstractDocument!

  5. #5
    aizen92 is offline Senior Member
    Join Date
    Nov 2010
    Posts
    155
    Rep Power
    11

Similar Threads

  1. Replies: 0
    Last Post: 10-20-2010, 03:47 PM
  2. Text-field templates.
    By jdipierro in forum New To Java
    Replies: 4
    Last Post: 05-14-2010, 12:48 AM
  3. Refreshing Text Field Value
    By nehakuls in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 11-13-2009, 11:05 AM
  4. [SOLVED] what is text limit line?
    By Nicholas Jordan in forum NetBeans
    Replies: 12
    Last Post: 07-16-2008, 05:05 AM
  5. Regarding Text Field
    By adeeb in forum AWT / Swing
    Replies: 1
    Last Post: 06-05-2008, 11:01 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
  •