Right I'm doing a simple application in Netbeans, that deals with large numbers so I want my Text Fields to be Formated.
Now right after input of the number to it(when you press enter, or when text field losses focus) I made it that a number is formated. like this number: 213999222 into:
I made it with this code:
now I want it that when a text field gets focus, I turn the formated string back into the old number: 213999222.
So that it would be like in excel (when you have a cell formated, and you double click on it to edit the data, its turned back into pure numbers)
Sounds like your IDE is messing with you, somehow. Because if the source isn't compilable, you should get an error when you compile it - and this error will tell you what the problem is. The error you've described is because your IDE is trying to run the code anyway.
You might be able to play with the NetBeans settings to get it to behave. What definitely should work, though, if that fails is to compile from the command line using javac.
Joined: Apr 19, 2011
I do get an error when I build it:
Compiling 1 source file to C:\Users\Uporabnik\Documents\NetBeansProjects\PartBuilder\build\classes
C:\Users\Uporabnik\Documents\NetBeansProjects\PartBuilder\src\Mojster\PartsBuilder.java:935: unreported exception java.text.ParseException; must be caught or declared to be thrown
C:\Users\Uporabnik\Documents\NetBeansProjects\PartBuilder\nbproject\build-impl.xml:531: The following error occurred while executing this line:
C:\Users\Uporabnik\Documents\NetBeansProjects\PartBuilder\nbproject\build-impl.xml:261: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)
also when I first put the code in, it didn't show any error on the source code, then it suddenly poped up after I ran it
now it shows it in source code too
Joined: Apr 19, 2011
Oh I found the solution, it looks that all it needs is a Try-Catch statement
and works ok now.
So the final code that works:
Thank for help guys and thank you for the welcome on this Forum Wouter Oet!
subject: Formating formated string back into original number