simple question - Help Please
i am doing my first java program with a gui. i can get a string from my JTextField(); and i need to get a double from that string. I found two possible ways of doing this on java.com, and another website. . .
way 1 -> from java.com ->class double method summary ->
staticdouble parseDouble(String s)
Returns a new double initialized to the value represented by the specified String, as performed by the valueOf method of class Double.
way 2 -> from javaworld.com -> Double.valueOf(j).doublevalue();
here is the part of my code in issue, unless i'm not importing something . . .
class OtherListenerimplements ActionListener
{
publicvoid actionPerformed(ActionEvent e)
{
if (e.getSource() == paidT)
{
String j = paidT.getText();
double paidTInput;
paidTInput = parseDouble(j);// way 1
Double.valueOf(j).doublevalue();// way 2
}
it seems to me that either should work, but when i try to compile i get an error saying
"cannot resolve symbol method parseDouble(java.lang.String)"
"cannot resolve symbol method doublevalue()"
I don't understand why I can't use these methods. I've included everything i can think of to give me access. It's probably something simple i'm doing wrong, but i can't figure out what that is. Thanks for any help.
here are my import statements, please tell me if i'm missing one or doing something wong . . .
import java.lang.Object.*;
import java.lang.Number.*;
import java.lang.Double.*;
import java.lang.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;

