I need help fixing my Java GUI. What I need it to do is have the user enter an item, then enter the weight of the item. However if the user enters 99999 or more for weight the GUI is supposed to print a GUI driven error message, and have the user re-enter a different weight. Also if the user enters a negative number it is supposed to show an error message. I have my GUI functioning, however just not properly. Can someone help me. Here is my code;

Code:
  /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui.week.pkg7;

/**
 *
 * @author befigard
 */

import java.awt.Component;
import java.util.*;
import javax.swing.JOptionPane;
public class GUIWeek7 {

    public GUIWeek7() {
    }

    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) 
                             
    	{
		WeightCalculator[] wc={new WeightCalculator()};
		int i=1;
                
		double d = 0;
		String str = null;
		Scanner s=new Scanner(System.in);
        Component frame = null;
		for(WeightCalculator var:wc)
		{
   if (d < 999999) {  
     
} else {  
    var.setWeight(d);    
    var.setDescription(str);  
}  
   
{    
    str=JOptionPane.showInputDialog ("Enter description of the object " );         
    d=Double.parseDouble(JOptionPane.showInputDialog ("Enter weight of the object: " ));    
         if (d < 99999) {  
        
    
    } else {  
              
         JOptionPane.showMessageDialog(frame,"Enter a weight less than 99999.", "Inane error",JOptionPane.ERROR_MESSAGE); 
        wc[i].setWeight(d);    
        wc[i].setDescription(str);    
    }  
}       
          
			var.setWeight(d);
			var.setDescription(str);

		}
		i=1;
		for(WeightCalculator var:wc)
		{
        	
         JOptionPane.showMessageDialog(null,"The weight of the item on Mercury is: " + var.mercuryWeight(),"Result ", JOptionPane.PLAIN_MESSAGE);
         JOptionPane.showMessageDialog(null,"The weight of the item on Earth is: " + var.earthWeight(), "Result ", JOptionPane.PLAIN_MESSAGE); 
         JOptionPane.showMessageDialog(null,"The weight of the item on the Moon is: " + var.moonWeight(),"Result ",JOptionPane.PLAIN_MESSAGE);
         JOptionPane.showMessageDialog(null, "The weight of the item on Jupiter is: "+ var.jupiterWeight(),"Result ",JOptionPane.PLAIN_MESSAGE);
                 
   
		}
	}
}                                    
/**
 *
 * @author befigard
 */

        class WeightCalculator {

        private double weight = 0.0;
        private String description = null;

        public double earthWeight() {
            return weight;
        }

        public double mercuryWeight() {
            return weight * .378;
        }

        public double moonWeight() {
            return weight * .166;
        }

        public double jupiterWeight() {
            return weight * 2.364;
        }

        public String getDescription() {
            return description;
        }

        public void setWeight(double weight) {
            this.weight = weight;
        }

        public void setDescription(String description) {
            this.description = description;
        }
    }