ActionListener
private class InputButtonListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
String rainString, wheatPriceString, barleyPriceString, sorghumPriceString;
double rain, wheatPrice, barleyPrice, sorghumPrice;
convert(enterRainfall, rainString, rain);
convert(enterWheatPrice, wheatPriceString, wheatPrice);
convert(enterBarleyPrice, barleyPriceString, barleyPrice);
convert(enterSorghumPrice, sorghumPriceString, sorghumPrice);
}
private void convert(JTextField textField, String string, double value)
{
string = textField.getText();
value = Double.parseDouble(string);
}
}
}
I am getting an error saying : variable rainString might not have been initialised. Anyone have any ideas on what I can do? aside from declaring the strings and doubles at the beginning of the entire class

