• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems with a customized JTextField

 
Paul Hayabusa
Ranch Hand
Posts: 45
  • 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,
 
Rob Camick
Ranch Hand
Posts: 2700
10
  • 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: 45
  • 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!