-
textfields in forms
i'm making a form that needs to take in floating point numbers using a textfield formatted as a float. I want to use the data as a float but when I do so it says it's a JFormattedtextfield.
Code:
JFormattedTextField test = new JFormattedTextField (new Float(0.00));
help would be much appreciated,
if this doesn't make any sense please say.
-
Re: textfields in forms
You're going to have to post the exact text of any error messages you receive.
-
Re: textfields in forms
I don't have any errors as of yet, i just want to have the data with in the JFormattedtext field to be stored as a float.
-
Re: textfields in forms
Okay, and what's preventing you from doing that?
-
Re: textfields in forms
I'm not sure how to go about from inserting the data from the JFormattedtextfields into a float.
Ultimately i wish to use the data from multiple JFormattedtextfields into a different class after clicking a button.
-
Re: textfields in forms
What have you tried? Where are you stuck?
Break your problem up into smaller pieces and identify which specific piece is giving you trouble. Can you get the text displayed in a text field? Can you convert a String into a float? Can you do the necessary error handling?