First off, I did search a bit. But being new and not really understanding much I'm not quite sure how to word things to get the answer I want. What I was able to find confused me more. But I did find a trend in answers, to which I'm sure someone will elude to.
Reading here and I don't quite understand it. (think it has something to do with not being able to see the result or what's being input)
Right now I've got this:
I think it should look something like this:Code:
int p = Integer.parseInt(pres.getText());
But that gives me an error that says "cannot find symbol" and the 'temp.getText());' is underlined (I know that means that's the trouble spot).Code:
int t = NumberFormat.getIntegerInstance(temp.getText());
So how should I fix this?
I have "java.text.NumberFormat" imported. And I think (from what I've found) there has to be a format and wording similar to the link I've posted ... "try" and "catch",, but where do user input numbers fit into those lines?
Not sure if it matters but I'm using NetBeans 6.9.1 and this is a jFrame application with tabs; very similar to what this tutorial taught me to do. Which I've noticed has the same problem. You can't input 30.5 hours worked or any decimal number. That is what i wish to fix and can not find how.
Also I'm am learning on my own from tutorials and searching. Never done any programming before. So be gentle please.