Results 1 to 3 of 3
  1. #1
    esallender is offline Member
    Join Date
    Oct 2010
    Posts
    9
    Rep Power
    0

    Default parseInt and getText

    I am having issues using parseInt and get Text when I write my code. can some one please tell me where I'm going wrong.

    heres the code:

    < public void pricechanger() { >
    < pCal.setpriceOfCar(Integer.parseInt(),jTextField4, getText()); } >

    :confused:

  2. #2
    goldest's Avatar
    goldest is offline Senior Member
    Join Date
    Oct 2009
    Location
    Pune, India
    Posts
    469
    Rep Power
    5

    Wink

    Quote Originally Posted by esallender View Post
    < pCal.setpriceOfCar(Integer.parseInt(),jTextField4, getText()); } >
    Where is the parameter for parseInt method? It takes a String usually which gets converted into integer. Refer here: Integer.parseInt

    The right way to call a method with a object reference is to use the dot operator with no space. Like,
    Java Code:
    object_variable.method_name(parameter(s) list)

    Following won't work [Considering you are calling getText() of JTextComponent.]

    Java Code:
    jTextField4, getText()

    Can you now figure out what went wrong?

    Goldest
    Java Is A Funny Language... Really!
    Click on * and add to member reputation, if you find their advices/solutions effective.

  3. #3
    esallender is offline Member
    Join Date
    Oct 2010
    Posts
    9
    Rep Power
    0

    Smile

    I figured it out thanks. some times you just got to walk away and try again later.

Similar Threads

  1. Help with getText()
    By geekchick in forum New To Java
    Replies: 17
    Last Post: 08-06-2010, 05:36 PM
  2. getText(); problem
    By The_Sponzy_Paradox in forum Java Applets
    Replies: 5
    Last Post: 04-22-2010, 03:07 AM
  3. What format is a getText()?
    By AJArmstron@aol.com in forum New To Java
    Replies: 1
    Last Post: 04-18-2010, 01:43 AM
  4. gettext problems
    By gisler in forum AWT / Swing
    Replies: 3
    Last Post: 12-01-2009, 07:35 PM
  5. how to getText() properly?
    By javamula in forum New To Java
    Replies: 12
    Last Post: 09-16-2009, 05:45 AM

Posting Permissions

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