Professional Documents
Culture Documents
Write A Java Applet To Display A Textual Content On The Browser
Write A Java Applet To Display A Textual Content On The Browser
17. Write a Java applet to display various shapes like circle, oval, rectangle, square
on the Browser.
import java.applet.Applet; import
java.awt.Graphics;
// Initialize Frame
public void init()
{
label1 = new Label("Enter Temprature In Celcius : ");
tempInput = new TextField(15);
// Display Result
if(ckgrp.getSelectedCheckbox().getLabel() == "kelvin")
{
output.setText("Temprature in Kelvin =
"+Double.toString(tempInp+273));
}
else {
output.setText("Temprature in Farenheight =
"+Double.toString((tempInp*1.8)+32));
}
}
}
}