Ok, I added the JButton "metWeight;" between the class and the constructor, and put the "metWeight = new JButton("Convert to kilograms");" inside the actionPerformed() method, but still nothing, and I tried adding the kilogram, weightOutput, and weightInput to eliminate those errors to, but to no avail. Was what I did even correct?
16 Replies - 1540 Views - Last Post: 21 February 2011 - 06:43 PM
#17
Re: The Opeartor * is undefined
Posted 21 February 2011 - 06:43 PM
I apologize for the double post, but I did manage to eliminate the errors related to kilogram, weightOutput, and weightInput, by putting them between the class and the constructor as well. However, the issue with the metWeight still exists. Here's the code that I'm referring to:
public class MetricConverterApp extends JFrame implements ActionListener
{
JButton metweight;
JFormattedTextField weightInput;
JTextField weightOutput;
double kilogram = 0.45359;
public MetricConverterApp()
{
...
...
...
if(e.getSource() == metWeight)
{
double value = Double.parseDouble(weightInput.getText());
weightOutput.setText((value * kilogram) + "");
}
|
|

New Topic/Question
Reply





MultiQuote


|