• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

JTextField input....

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Still i am sorry...i have hurt anybody and wasted anybodies time...
 
Willie Smits can speak 40 languages. This tiny ad can speak only one:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic