Results 1 to 6 of 6
  1. #1
    lolzord is offline Member
    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0

    Default 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.

    Java Code:
    JFormattedTextField test = new JFormattedTextField (new Float(0.00));
    help would be much appreciated,

    if this doesn't make any sense please say.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,932
    Rep Power
    8

    Default Re: textfields in forms

    You're going to have to post the exact text of any error messages you receive.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    lolzord is offline Member
    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0

    Default 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.

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,932
    Rep Power
    8

    Default Re: textfields in forms

    Okay, and what's preventing you from doing that?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    lolzord is offline Member
    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0

    Default 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.

  6. #6
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,932
    Rep Power
    8

    Default 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?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. TextFields not showing up
    By Army in forum New To Java
    Replies: 7
    Last Post: 06-20-2012, 06:36 PM
  2. textfields - cursor
    By newbie123 in forum AWT / Swing
    Replies: 6
    Last Post: 09-29-2011, 06:39 PM
  3. adding textfields
    By themanepalli in forum Java Applets
    Replies: 1
    Last Post: 12-28-2010, 03:56 AM
  4. Replies: 2
    Last Post: 04-28-2008, 10:56 AM
  5. information from a textfields
    By bbq in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 06-28-2007, 05:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •