Java Tutorial | Limiting Chars on JTextField using PlainDocument (Validation)

preview_player
Показать описание
In this tutorial I look at limiting user input on a JTextField, to achieve this, I had to use PlainDocument to actually get the TEXT on the JTextfield.

I will give the code upon request, also note on 6:48 the output doesn't convert to uppercase I had Caps long on.

Feel free to drop any question on the comment section. :D.
Рекомендации по теме
Комментарии
Автор

hey it can not work when using netbeans GUI with JTextField

nhathuynh
Автор

hi, I have a question.. i want a help with a code im working on... how / where can I show the code and the details?
im not able to send you a msg on utube.

RUTURAJMACKWAN
Автор

Is it possible to get the code for this?

Monasso
Автор

Could I get the code please?
Also if you limit the characters does that mean that JTextField must have that many characters or can it have less. Because i tried doing a JFormattedTextField and the text inside would disappear if it wasn't at the maximum number of characters?
-Thanks in advance

mobinamanzai
Автор

I looked at the code, you done half of the job you just need to link it to GUI interface. First create the JFrame, create two buttons, each openning another JFrame or JPanel for different forms, you set the JFrame layout to flowlayout();, then you will need to create and Label you textfield, a JLabel followed by a JTextfield. then you get the string then apply to the methods you created it by instantiating it, I am really curious where your storing these stuff ???? Like into a file.

ismailzd
Автор

Very good, thanks!
this resolved my problem.

leandrocadete
Автор

i know this is almost 7 years old, but please, if you can read this.. please tell me how to insert that code into netbeans's auto generated codes for the GUI

hafidz
Автор

Hey, go on pastie.org, paste the code then send it to me, make sure you comment it out so I can understand what you're trying to achieve :D.

ismailzd
Автор

Obrigado por compartilhar seu conhecimento.

rafaelnalevaiko
Автор

can i pm you? if you have a fb page or anything... so that I can explain in detail... :)

RUTURAJMACKWAN
Автор

thanks ... see u on fb messenger in a minute!!

RUTURAJMACKWAN