Switch to full style
Project under GPL source codes are posted here
Post a reply

Browser Celsius to Fahrenheit Converstion applet

Mon May 26, 2008 12:22 am

* Project Name:   Celsius to Fahrenheit Converstion applet
* Programmer:   msi_333
* Type:   Math
* Technology:  Java applets
* IDE:   NetBeans
* Description:   This is a simple applet which convert from Celsius to Fahrenheit Converstion degrees
This is live applet :grin:
java code
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JSlider;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

/**
*
* @author SAMI
*/
public class mApplet extends JApplet implements ChangeListener{

/** Creates a new instance of Main */
private JSlider slider=new JSlider(JSlider.HORIZONTAL,0,100,30);
private JLabel CLable=new JLabel("Celsius :");
private JLabel FLable=new JLabel("Fahrenheit :");
private JLabel CLableValue=new JLabel("");
private JLabel FLableValue=new JLabel("");
private Container cp;
private float CDegree;
private float FrDegree;

public mApplet() {


cp=getContentPane();
slider.addChangeListener(this);
CDegree=slider.getValue();
getFahrenheit();
updateTexts();
cp.setLayout(new GridLayout(3,3));
cp.add(CLable);
cp.add(CLableValue);
cp.add(FLable);
cp.add(FLableValue);
cp.add(slider);

}

public void init() {

}
public void start() {

}
public void stop() {

}
public void destroy() {

}

public void stateChanged(ChangeEvent e) {
CDegree=slider.getValue();
getFahrenheit();
updateTexts();
}

public void getFahrenheit() {
FrDegree=(float)(CDegree*(float)9/5) + 32;
}
public void updateTexts()
{
CLableValue.setText(Float.toString(CDegree));
FLableValue.setText(Float.toString(FrDegree));
}
}



Sample.rar
NetBeans Project
(24.38 KiB) Downloaded 1217 times




Re: Browser Celsius to Fahrenheit Converstion applet

Mon Jan 21, 2013 12:43 am

updated.

Post a reply
  Related Posts  to : Browser Celsius to Fahrenheit Converstion applet
 convert from celsius to fahrenheit or vice versa     -  
 $.browser Check if your browser is IE or FireFox or Chrome     -  
 Browser     -  
 Browser Support     -  
 how can we get browser information in jsp?     -  
 AJAX - Browser support     -  
 Whats your favourite browser?     -  
 Video Archive Browser in java     -  
 Java Web Browser (Mini Project)     -  
 Get the client navigator browser type or operating system     -  

Topic Tags

Java Applet