• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Problems with a customized JTextField

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a component that works fine for a lot of things, like register data in different ranges but i found out when i display a INTEGER data(example 11) from DB, it shows wrong.If i put to display with 2 decimals, it shows 0,11(instead of 11,00).with one decimal, it shows 1,1(instead 11,0).The component is below:

Example of how i use:

Where is the mistake?


Best Wishes,
 
Rancher
Posts: 3063
23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No need to create a custom class.

See: How to Use Formatted Text Fields
 
Paul Hayabusa
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks,
Rob Camick , but i found my mistake!
Its just use setValue instead of setText...yeah, very stupid.

Thanks, for your help!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!