Hi there, im having problem converting my string to integer..
Basically my program is a dispenser that holds items, there price and quantity I can manipulate these through txtbox's which are defined as arrays and then i show them using a txtarea.
My currently problem is that im wanting to show the price of my items through the txt area I can display my items names as follows
For my items price which are currently declared as int I am trying to do the followingfor(int i =0; i<myDispenser.length; i++){ String itemName = txtadditem[i].getText(); I then call my items names; output = output + " Product Name "+ ":" + myDispenser[i].getItemName();
however I get this errorString Price = txtprice[i].getText(); itemPrice = Integer.parseInt(Price);
Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(Unk nown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
I've been trying for several days and still cant see my problem any help would be appreciated if my code that I have displayed is insufficient please say so..
Many thanks