Java Reference
In-Depth Information
double result = value*9.0/5.0+32.0;
txtResult.setText("fahrenheit = "+res-
ult);
}
catch (NumberFormatException nfe)
{
System.err.println("bad input");
}
}
};
Button btnConvertToFahrenheit = new Button("convert
to fahrenheit");
btnConvertToFahrenheit.addActionListener(al);
pnlTemp.add(btnConvertToFahrenheit);
pnlLayout.add(pnlTemp);
return pnlLayout;
}
public static void main(String[] args)
{
Runnable r = new Runnable()
{
@Override
public void run()
{
final
Frame
f
=
new
Frame("tempverter");
f.addWindowListener(new WindowAd-
apter()
{
@Override
public
void
windowClos-
ing(WindowEvent we)
{
f.dispose();
}
});
Search WWH ::




Custom Search