• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextField input....

 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i have a JTextField and want only integer input in it using setText() method.
So what do i put in setText to do that??
for decimal input i used : taxChrBusTxt.setText(taxDecFormatter.format(chrBusInc));

taxDecFormatter is object of type DecimalFormat...

thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setText() takes a String argument, so one of the ways would be
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in reference to your post on sun ...
michael look one thing first of all i am new to the forums so initially such things might happen as i posted the topic the same topic that you replied to
accidentally on applet section as initially i didn't found swing section and bookmarked the applet section topic rather than swings; there i didn't
received any replies(as it shouldn't topic placed at wrong section)
So i registered on sun to get the answer to my question which i manipulated as earlier i was in hurry when posted here(i will see to it that questions are not poorly constructed).
And you need not use such language as i wouldn't do any good...anyways....
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still i am sorry...i have hurt anybody and wasted anybodies time...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!