Author Topic: toString method not found?  (Read 2604 times)

0 Members and 1 Guest are viewing this topic.

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
toString method not found?
« on: August 08, 2011, 12:53:14 pm »
 ??? for some reason when i do String someString = new String(Integer.toString(number));  (being I have a string called 'some string' and an int called 'number) it gives me this error:


Code: [Select]
--------------------Configuration: link generator - JDK version 1.6.0_26 <Default> - <Default>--------------------
C:\Users\user\Desktop\link generator\src\link_generator.java:53: cannot find symbol
symbol  : method toString(javax.swing.JTextField)
location: class java.lang.Integer
String someString = new String(Integer.toString(number));
                                          ^
1 error

Process completed.


This is being used in an applet if that makes a difference.. which it shouldnt
Loved this place, still the best producers of power metal, and sparked my dreams of coding.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: toString method not found?
« Reply #1 on: August 08, 2011, 12:59:58 pm »
Okay, read the error again, just don't look over it again.  It's not saying it didn't find any toString method, it just didn't find one that took javax.swing.JTextField as a parameter, which apparently number is.

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
Re: toString method not found?
« Reply #2 on: August 08, 2011, 01:08:06 pm »
i fixed it, thanks for your help :)
« Last Edit: August 08, 2011, 01:13:35 pm by Snake X »
Loved this place, still the best producers of power metal, and sparked my dreams of coding.