Ok heres the code
public void actionPerformed (ActionEvent e)
{
String Product_Size_Str= ("Product Size:");
Product_Name= Product_Name_TextField.getText();
Output_Capacity= Double.parseDouble(Output_Capacity_TextField.getText());
if (Product_Name.compareTo ("") == 0);
{JOptionPane.showMessageDialog (null,
"Error: Product Name cannot be blank!",
"Error!", JOptionPane.ERROR_MESSAGE);
}
if (Output_Capacity_TextField.getText().compareTo ("") <100)
{JOptionPane.showMessageDialog (null,
"Error: Output Capacity must be greater than 100!",
"Error!", JOptionPane.ERROR_MESSAGE);
}
else (Output_Capacity_TextField.getText().compareTo ("") >2000);
{JOptionPane.showMessageDialog (null,
"Error: Output Capacity must be less than 2000!",
"Error!", JOptionPane.ERROR_MESSAGE);
}
It comes up with an error for the else bit where the bracket and Output capacity is that its not a statement help me!!!
And can anyone identify whats wrong with it?
public void actionPerformed (ActionEvent e)
{
String Product_Size_Str= ("Product Size:");
Product_Name= Product_Name_TextField.getText();
Output_Capacity= Double.parseDouble(Output_Capacity_TextField.getText());
if (Product_Name.compareTo ("") == 0);
{JOptionPane.showMessageDialog (null,
"Error: Product Name cannot be blank!",
"Error!", JOptionPane.ERROR_MESSAGE);
}
if (Output_Capacity_TextField.getText().compareTo ("") <100)
{JOptionPane.showMessageDialog (null,
"Error: Output Capacity must be greater than 100!",
"Error!", JOptionPane.ERROR_MESSAGE);
}
else (Output_Capacity_TextField.getText().compareTo ("") >2000);
{JOptionPane.showMessageDialog (null,
"Error: Output Capacity must be less than 2000!",
"Error!", JOptionPane.ERROR_MESSAGE);
}
It comes up with an error for the else bit where the bracket and Output capacity is that its not a statement help me!!!
And can anyone identify whats wrong with it?