Question: Need help cleaning this up: Giving me errors because I don't have Main but when I put it in it doesn't run. Using Netbeans Java

Need help cleaning this up: Giving me errors because I don't have Main but when I put it in it doesn't run. Using Netbeans Java - Java Class Library.

import java.applet.Applet; import java.awt.*; import java.awt.event.*;

public class Temper extends Applet { private final Button Calculate; private Label lblFahrenheit; private Label lblCelsius; private TextField txtFahrenheit; private TextField txtCelsius; private final Panel p; private String label; } /** * Initialization method that will be called after the applet is loaded into * the browser. */ @Override public static void main(String[] args) // TODO start asynchronous download of heavy resources } { setBackground (Color.blue); p = new Panel (); p.setLayout (new GridLayout (5, 1, 12, 12)); txtFahrenheit = setField (p, txtFahrenheit, lblFahrenheit, "Fahrenheit"); txtCelsius = setField (p, txtCelsius, lblCelsius, "Celsius"); Calculate = new Button ("Calculate"); Calculate.addActionListener ((ActionListener) new CalculateListener ()); p.add (Calculate); add (p); } // method init

private TextField setField(Panel p, TextField txtFahrenheit, Label lblFahrenheit, String fahrenheit) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } // Inner class to listen for the Calculate button. class CalculateListener implements ActionListener { public void actionPerformed (ActionEvent event) { double fahrenheit, celsius; fahrenheit = getDouble(txtFahrenheit); celsius = (fahrenheit - 32) * 5 / 9; txtCelsius.setText ("celsius"); } // method actionPerformed } // class CalculateListener

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!