Hi, I am trying to print out a decimal number like 13.45 in JTextField. I do convert this number from a Double to String and send it to JTextField, but in the applet all I get is 1345 followed by a small square. I tried to type 13.45 in the text field, but it does not let me print "." What should I do? Should I use another component to display decimal numbers? thanks, Alex
All right brain, you don't like me and I don't like you, but let's just do this one thing so I can get back to killing you with beer.<br /> <br />- Homer Simpson
posted 14 years ago
JTextField is fine. How are you converting to a String. Are you using DecimalFormat or just doing a toString? You should use the DecimalFormat to control how you want the number to appear.