So i am currently teaching myself the GUI coding with a java book for college, and i understand it all but i ge this error and i am stumped.
import javax.swing.*;
import BreezySwing.*;
public class gui
{
public class ConvertWithGUI extends GBFrame
{
private JLabel fahrenheitLabel;
private JLabel celsiusLabel;
private DoubleField fahrenheitField;
private DoubleField celsiusField;
private JButton fahrenheitButton;
private JButton celsiusButton;
public ConvertWithGUI()
{
fahrenheitLabel = addLabel ("Fahrenheit" ,1,1,1,1);
celsiusLabel = addLabel ("Celsius" ,1,2,1,1);
fahrenheitField = addDoubleField (32.0 ,2,1,1,1);
celsiusField = addDoubleField (0.0 ,2,2,1,1);
fahrenheitButton= addButton (">>>>>>" ,3,1,1,1);
celsiusButton = addButton ("<<<<<<" ,3,2,1,1);
}
public void buttonClicked (JButton buttonObj)
{
Thermometer thermo = new Thermometer();
if (buttonObj == fahrenheitButton)
{
thermo.setFahrenheit(fahrenheitField.getNumber());
celsiusField.setNumber (thermo.getCelsius());
}
else
{
thermo.setCelsius(celsiusField.getNumber());
fahrenheitField.setNumber (thermo.getFahrenheit());
}
}
public static void main(String[] args)
{
ConvertWithGUI theGUI = new ConvertWithGUI();
theGUI.setSize(250, 100);
theGUI.setVisible(true);
}
}
}
Ok so everything up to the part that is labeled:
ConvertWithGUI theGUI = new ConvertWithGUI();
results in the error. more specifically it is highlighted on this part:
new ConvertWithGUI();
Now the basic function of this program is to convert from and to Celsius. It is simple i know but i do not know what this error is, and i am typing this exact from the book. If anyone could help it will be appreciated! Thank you.