Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to accept a single digit number in a JTextField[][] num = new JTextField[9][9];

i tried using
num.getMaximumLength();
|| num.setMaximumLength();
from predefined functions, but it is not working!
Posted
Updated 28-Jan-14 18:20pm
v2

1 solution

Set document for the respected JTextField. You need to create a subclass of PlainDocument which basically hold the logic for length restriction(or any other logic if you want)

Here is the reference link click
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900