• Post Reply Bookmark Topic Watch Topic
  • New Topic

maximum allowed character in JTextArea  RSS feed

 
Kavita Shivani
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

In my application, soon as I enter more than 249 characters in my JTextArea, the buttons stop functioning. I am not sure if its a problem with the actionperformed method of the button, or the number of characters in text area. Also I want to be able to increase number of characters entered in the JTextArea to something close to 1000 characters.
Please suggest.

thanks,
Kavitha.
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's definitely something in your code doing that, since a standard JTextArea isn't limited to 249 characters. But since we can't see any of your code, of course we can't say anything more meaningful than that. Could you post a small and focused example? (I.e. not a whole 600-line class which has a JTextArea and twenty other components.)
 
Kavita Shivani
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the quick response Paul.

Based on your response, I started debugging the action performed method, I am maintaining an already developed application. Interestingly somewhere deep inside the code, while they do 101 other things, they also restrict all the UI input fields to not exceed some max value. If it does, they throw an exception, which is caught in the action performed level as a general exception and swallowed up, not even logged or printed to the console or shown to the user that it exceeded the max characters. .

thanks,
Kavitha.

 
Campbell Ritchie
Marshal
Posts: 56541
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think we can understand the problem without seeing some code. And I shall move this thread because it isn't a "beginning" problem.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!