I'm writing a program that calculates gravitational force and when ran the program gives me a result of NaN for the solution to the equation.

Class initiate:

public class initiate {
public static void main(String[] args) {
gui g=new gui();
g.setVisible(true);
g.setDefaultCloseOperation(3);
g.setSize(600, 200);
}

}

Class GUI:

import java.awt.Choice;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

public class gui extends JFrame {
/**

*/
private static final long serialVersionUID = 1L;
private JLabel wl=new JLabel("Weight Of Object 1: ");
private JTextField w=new JTextField(10);
private Choice ws=new Choice();
private String[] cs={"Kg","Tons","Pounds"};
private JLabel wl2=new JLabel("Weight Of Object 2: ");
private JTextField w2=new JTextField(10);
private Choice ws2=new Choice();
private JLabel dl=new JLabel("Distance From Object: ");
private JTextField d=new JTextField(10);
private Choice du=new Choice();
private String[] dup={"Mile","Light Year","Feet","Meters"};
private JButton s=new JButton("Solve");
private Component[] comps={wl,w,ws,wl2,w2,ws2,dl,d,du,s};
private float weight1,weight2;
private float distance;
gui(){
super("Gravitational Force Calculator");
setLayout(new FlowLayout());
for(String g:dup){
du.add(g);
}
for(String c:cs){
ws.add(c);
ws2.add(c);
}
for(Component x:comps){
add(x);
}
s.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
if(ws.getSelectedIndex()==0){
try{
weight1=Float.parseFloat(w.getText());
}catch(Exception e1){
JOptionPane.showMessageDialog(null, "Please Put In a Number");
}
}
if(ws.getSelectedIndex()==1){
try{
weight1=(float) (Float.parseFloat(w.getText())*907.185);
}catch(Exception e1){
JOptionPane.showMessageDialog(null, "Please Put In a Number");
}
}
if(ws.getSelectedIndex()==2){
try{
weight1=(float) (Float.parseFloat(w.getText())*0.453592);
}catch(Exception e1){
JOptionPane.showMessageDialog(null, "Please Put In a Number");
}
}
if(ws2.getSelectedIndex()==0){
try{
weight1=Float.parseFloat(w2.getText());
}catch(Exception e1){
JOptionPane.showMessageDialog(null, "Please Put In a Number");
}
}
if(ws2.getSelectedIndex()==1){
try{
weight1=(float) (Float.parseFloat(w2.getText())*907.185);
}catch(Exception e1){
JOptionPane.showMessageDialog(null, "Please Put In a Number");
}
}
if(ws2.getSelectedIndex()==2){
try{
weight1=(float) (Float.parseFloat(w2.getText())*0.453592);
}catch(Exception e1){
JOptionPane.showMessageDialog(null, "Please Put In a Number");
}
}
float solve=(float)(weight1*weight2);
if(du.getSelectedIndex()==0){
try{
distance=(float)(Float.parseFloat(d.getText())*1609.34);
}catch(Exception e1){
JOptionPane.showMessageDialog(null, "Please Put In a Number");
}
}
if(du.getSelectedIndex()==1){
try{
distance=(float)(Float.parseFloat(d.getText())*(9.461*(Math.pow(10,15))));
}catch(Exception e1){
JOptionPane.showMessageDialog(null, "Please Put In a Number");
}
}
if(du.getSelectedIndex()==2){
try{
distance=(float)(Float.parseFloat(d.getText())*0.3048);
}catch(Exception e1){
JOptionPane.showMessageDialog(null, "Please Put In a Number");
}
}
solve=(float)(solve/(Math.pow(distance,2)));
solve=(float) (solve*(6.67*(Math.pow(10,-11))));
JOptionPane.showMessageDialog(null, "The Gravitational Force is "+Float.toString(solve)+" Newtons");
}
});
}  
}