Swapnil Ware 1212-1
Swapnil Ware 1212-1
INSTITUTE OF TECHNOLOGY
TYCO SEMESTER-5th
Microproject On
“Currency converter using AWT”
Submitted To:-
Prof:Dumber.S.A.
7
PUNE DISTRICT EDUCATION ASSOCIATION
INSTITUTE OF TECHNOLOGY
We completed our work in good co-ordination and hardworking. First we started collecting
information about if else statements and lClass And we started to form report on that concept.
Finally we completed the project with good outcomes.
4.0 Action Plan (Sequence and time required for major activity)
Name of
Sr. Planned Start Planned Responsible
Details of activity
No. date Finish date
Team Members
1 MS-Word 2010 1
2 Laptop RYZEN 5@345GH 8GB 1
Ram
3 IDE interlay 1
Annexure – II
7
PUNE DISTRICT EDUCATION ASSOCIATION
INSTITUTE OF TECHNOLOGY
ACKNOWLEDGMENT
I wish to express our profound and sincere gratitude to our guide.
Who guided us into the intricacies of this micro-project non-chalantly with matchless
magnanimity. We are indebted to his constant encouragement, co-operation and help. It was his
enthusiastic support that helped us in overcoming him various obstacles in this project.
I would also like to express our thankfulness to our beloved Principal, H.O.D., and other
faculty members our Fifth Year Department for extending their support and motivation.
Thank You…..!!!!
7
PUNE DISTRICT EDUCATION ASSOCIATION
INSTITUTE OF TECHNOLOGY
Introduction
Swing is apart of the JFC (Java Foundation Classes) . Building Graphical User
Interface in java requires the use of Swing. Swing Framework contains largest of
components which allow a high level of customization and provide rich
functionalities and is used to used create window-based application. Java swing
components are lightweight, platformindependet, provide powerful components
like tables, scroll panels, button, list, color chooser, etc.
In this article, we’ll see how to make a currency convertor which includes
conversion between INR and Dollar. Tow textfield are implemented with the lable
Rupees and Dollar.
7
PUNE DISTRICT EDUCATION ASSOCIATION
INSTITUTE OF TECHNOLOGY
Abstract:
Approach:
Program code:
import javax.swing.*;
import java.awt.event.ActionEvent; import
java.awt.event.ActionListener; import
java.awt.event.WindowAdapter; import
java.awt.event.WindowEvent;
public class CFG
{
public static void Converter()
{
JFrame f=new JFrame("CONVERTER");
JLabel l1,l2;
JTextField t1,t2; JButton
b1,b2,b3;
l1 = new JLabel("Rupees");
l1.setBounds(20,40,60,30); //20,40,60,30 l2 = new
JLabel("Dollars");
t1 = new JTextField("0");
t1.setBounds(80,40,50,30); //80,40,50,30 t2 = new
JTextField("0");
t2.setBounds(240,40,50,30); //240,40,50,30
b1 = new JButton("INR");
b1.setBounds(50,80,80,15); //50,80,60,15
b2 = new JButton("Dollar");
b2.setBounds(190,80,75,15); //190,80,60,15
b3 = new JButton("close");
b3.setBounds(130,130,75,30); //150,150,60,30
b1.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
7
PUNE DISTRICT EDUCATION ASSOCIATION
INSTITUTE OF TECHNOLOGY
}
});
b2.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
double d2 = Double.parseDouble(t2.getText());
double d3 = (d2 * 75.13);
String str2 = String.valueOf(d3);
t1.setText(str2);
}
});
b3.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
f.dispose();
}
});
f.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
f.add(l1);
f.add(t1);
f.add(l2);
f.add(t2);
f.add(b1);
f.add(b2);
f.add(b3);
7
PUNE DISTRICT EDUCATION ASSOCIATION
INSTITUTE OF TECHNOLOGY
f.setLayout(null);
f.setSize(400,300);
f.setVisible(true); }
Output:
1.The Window displayed on running the program:
7
PUNE DISTRICT EDUCATION ASSOCIATION
INSTITUTE OF TECHNOLOGY
Conclusion:
7
PUNE DISTRICT EDUCATION ASSOCIATION
INSTITUTE OF TECHNOLOGY
Reference:www.geeksforgeeks.com
www.javapoint.com
Thank You!!!!!....