Hello to anyone who can help me.
I'm a freshman in comp sci and here is my problem:
I need to have the user type in a number in a JOptionPane input box, and I need to change the number they input into a double.
Here's what I have, it doesn't work:
import javax.swing.JOptionPane;
public class Transfer
{
public static void main(String[] args)
{
Person jeff = new Person(300, 1000);
Person kwame = new Person(150, 0);
jeff.lookInWallet();
jeff.lookInAccount();
kwame.lookInWallet();
kwame.lookInAccount();
[I]String t = JOptionPane.showInputDialog([/I][I]"To:"[/I][I]);
String f = JOptionPane.showInputDialog("From:"[/I][I]);
String a = OptionPane.showInputDialog("Amount (In Dollars.Cents):"[/I][I]);[/I]
if(t = "jeff")
{
new Check(jeff, kwame, a);
}
else if(t = "kwame")
{
new Check(kwame, jeff, a);
}
else
System.out.print("No person by that name, make sure you are case-sensitive (jeff, not Jeff)");
jeff.lookInWallet();
jeff.lookInAccount();
kwame.lookInWallet();
kwame.lookInAccount();
}
}
Ignore everything except the italicized area.
Also, if anyone knows how to have the user input a string, and then from that string, set the parameters for a new object, please tell me.
Thanks.