Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting String to Int 1

Status
Not open for further replies.

NBartomeli

Programmer
Jul 1, 2003
111
US
I seem to be unable to find a way to convert a String value to Int. Can someone please help me?

I need to pass the value returned from a JOptionPane.showInputDialog() to a graphics funtion in an applet, and the function calls for Int's (not Integers, Doubles, etc)

Can someone help me with this?

Thanks in advance
 
I need to cast to Int, not Integer. They are different. But thank you for your input
 
apparently I was the one who was mistaken.

Thank you for your input, this worked out well
 
By the way. if you do need int and not integer, you can just do:
Code:
Integer i = Integer.parseInt(%string_name);
int a = i.intValue;
[code]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top