This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
May as well warn you now, your name doesn't fit the naming policy. In other words you need to have a full last name, not an inital!
And on your code, the whole putting an int to an optionPane just doesn't seem right to me, but I'm not very experenced and it may be perfectly fine. Sorry I'm not of much help there! [ August 31, 2005: Message edited by: Atrus Greyor ]
Joined: Aug 30, 2005
by int i mean a number input by a person
Joined: Jun 09, 2003
would you like any further responses posted here, or at sun?
Hi adam, These two links will take you to the two packages that contain the classes that you need to consider Class JOptionPane with showinputDialog method that returns a String , even though you are typing in a number at JOptionPane it is still recognised as a string ,it must be parsed .Thejava lang package (which is imported implicitly) which contains the class, which contains the methods for changing your String input into an int
Originally posted by Adam C.: almost the whole time i was just missing the number=(int) typecast
Actually the cast shouldn't be necessary, as parseInt already returns an int, doesn't it?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus