Ajpfinal R
Ajpfinal R
UNDER GUIDANCE OF
Mrs.J.A.Salunkhe
LECTURER,COMPUTER ENGINEERING DEPARTMENT
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(2024-2025)
GOVERNMENT POLYTECHNIC, THANE
Institute Vision:
To create component technical manpower to cater Industrial and
Social needs.
Institute Mission:
We are committed to-
CERTIFICATE
1 Rational 1
6 Output of micro-project 16
7 Resourced Used 17
“Temperature Converter”
1. Rational:-
java.awt.event.*;
JButton n0, n1, n2, n3, n4, n5, n6, n7, n8, n9;
public TC(String s) {
super(s);
JComboBox(arr1);
= new JTextField();
t2 = new JTextField();
b = new JButton("Convert");
JButton("<--"); ac = new
JButton("AC"); n0 = new
JButton("0"); n1 = new
JButton("1"); n2 = new
JButton("2"); n3 = new
JButton("3"); n4 = new
JButton("4"); n5 = new
JButton("5"); n6 = new
JButton("6"); n7 = new
JButton("7"); n8 = new
JButton("8"); n9 = new
JButton("9");
setLayout(null);
b.addActionListener(new Handler());
ac.addActionListener(new Handler());
pm.addActionListener(new Handler());
bs.addActionListener(new Handler());
dot.addActionListener(new Handler());
n0.addActionListener(new Handler());
n1.addActionListener(new Handler());
n2.addActionListener(new Handler());
n3.addActionListener(new Handler());
n4.addActionListener(new Handler());
n5.addActionListener(new Handler());
n6.addActionListener(new Handler());
n7.addActionListener(new Handler());
n8.addActionListener(new Handler());
n9.addActionListener(new Handler());
add(tc1);
add(tc2);
add(l1);
add(l2);
add(l3);
add(l4);
add(t1);
add(t2);
add(b);
add(ac);
add(dot);
add(pm); add(bs);
add(n0);
add(n1);
add(n2);
add(n3);
add(n4);
add(n5);
add(n6);
add(n7);
add(n8);
add(n9);
t2.setEditable(false);
void actionPerformed(ActionEvent e) {
String x, y;
x = (String) tc1.getSelectedItem(); y
= (String) tc2.getSelectedItem();
if (e.getSource() == n0)
t1.setText(t1.getText() + "0"); if
(e.getSource() == n1)
t1.setText(t1.getText() + "1"); if
(e.getSource() == n2)
t1.setText(t1.getText() + "2"); if
(e.getSource() == n3)
t1.setText(t1.getText() + "3"); if
(e.getSource() == n4)
t1.setText(t1.getText() + "4"); if
(e.getSource() == n5)
t1.setText(t1.getText() + "5"); if
(e.getSource() == n6)
t1.setText(t1.getText() + "6"); if
(e.getSource() == n7)
t1.setText(t1.getText() + "7"); if
(e.getSource() == n8)
t1.setText(t1.getText() + "8"); if
(e.getSource() == n9)
t1.setText(t1.getText() + "9"); if
(e.getSource() == dot)
t1.setText(t1.getText() + "."); if
(e.getSource() == ac) {
t1.setText("");
t2.setText("");
}
if (e.getSource() == pm) {
(spm.length() == 0)
t1.setText("-");
t1.setText("" + spm.substring(1));
n;
= t1.getText();
n = bsp.length();
t1.setText("" + bsp.substring(0, n - 1));
}
if (e.getSource() == b) {
+ t1.getText());
+ t1.getText());
+ t1.getText());
+ t1.getText());
} else if (x == "Reaumur" && y == "Reaumur") { t2.setText(""
+ t1.getText());
// Celsius to others.........................
5 + 32 + 459.67);
t2.setText("" + b);
} else if (x ==
String s = t1.getText();
float a =
Float.parseFloat(s); float b
= (float) (a * 0.8);
t2.setText("" + b);
// Fahrenheit to others......................
String s = t1.getText();
float a = Float.parseFloat(s);
t2.setText("" + b);
} else if (x ==
String s = t1.getText();
float a = Float.parseFloat(s);
t2.setText("" + b);
// Kelvin to others.........................
String s = t1.getText();
float a = Float.parseFloat(s);
t2.setText("" + b);
5);
t2.setText("" + b);
} else if (x ==
String s = t1.getText();
float a = Float.parseFloat(s);
+ b);
// Rankine to others............................
String s = t1.getText();
float a = Float.parseFloat(s);
t2.setText("" + b);
t2.setText("" + b);
} else if (x ==
String s = t1.getText();
float a = Float.parseFloat(s);
t2.setText("" + b);
// Reaumur to others........................
String s = t1.getText();
float a = Float.parseFloat(s);
} else if (x ==
String s = t1.getText();
float a = Float.parseFloat(s);
t2.setText("" + b);
jf.setVisible(true);
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
6. Output of micro-project:
7. Resources used:-
Mrs. J. A. Salunkhe
(Lect. In Computer Engineering Department)