Originally posted by mo robertson: ok i have an integer called 'Price' which has been declaired on a class i want to set price to a textbox, but it doesnt let me becuase its integer, string works fine. how would this be ?
h[count].Price= "" + jTextField7.getText ();
Normally your integer would be called 'price' because only classes should be capitalized.
If your price can contain cents, then you can have a proble with decimal point.
What you will get from the text box, even if the user type all numeric digits, is an ascii string. You can call Integer.parseInt (jTextField7.getText ()) to convert it to an int. You can place that in a try/catch block in case the user did not type a convertable number.
Mo used to be a famous comedian in Australia over 50 years ago so I love your name.
Ed [ May 21, 2004: Message edited by: Eddie Vanda ]
The nice thing about Standards is that there are so many to choose from!