• 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • 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: 3073
24
  • 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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!