How to Make Currency Converter in Java?
In this program, we will learn to create a currency converter using the java swing component.
Currency Converter in Java Source Code:
import java.awt.*;
import javax.swing.*;
import java.applet.*;
import java.awt.event.*;
class CurrencyConveter extends JFrame implements ActionListener
{
JFrame f;
JLabel l1,l2;
JTextField t1,t2;
JButton b1,b2;
JComboBox c1,c2;
CurrencyConveter()
{
f=new JFrame("Currency Conveter");
String[] currency={"US Dollar","Indian Rupee","British Pound","Euro","Chinese Yuan"};
c1=new JComboBox(currency);
c1.setSelectedIndex(0);
c1=new JComboBox(currency);
//c2.setSelctedIndex(1);
l1=new JLabel("enter your currency");
l2=new JLabel("conveted currency is:");
CheckboxGroup g=new CheckboxGroup();
Checkbox i=new Checkbox("India",g,true);
Checkbox u=new Checkbox("usa",g,false);
Checkbox n=new Checkbox("Nepal",g,false);
Checkbox m=new Checkbox("Malaysia",g,false);
t1=new JTextField(10);
t2=new JTextField(10);
b1=new JButton("convert");
b2=new JButton("cancel");
f.setVisible(true);
f.setSize(400,400);
f.setLayout(new FlowLayout());
f.add(l1);
f.add(t1);
f.add(b1);
f.add(b2);
f.add(l2);
f.add(t2);
b1.addActionListener(this);
b2.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
}
public static void main(String []pp)
{
new CurrencyConveter();
}
}
COMPLETED PROJECTS:
- How to Create Forgot System Password with PHP & MySQL
- Datatables Editable Add Delete with Ajax, PHP & MySQL-My programming school
- Download Login and Registration form in PHP & MySQL-MPS
- Export Data to Excel in Php Code -My programming school
- Hospital Database Management System with PHP MySQL
- Java projects for beginners | java developer software | UML diagram
- Traffic Light using Applet in Java | algorithm and source code
- Currency converter using java
- Java program to design simple calculator with the use of grid layout
- Simple Notepad Editor using java|Gui application
- Online quiz application using java GUI with complete source code
- How to create color changer mini-project using java applet with source code
- How to make a Calculator using java Swing, GUI
- Canteen food order, generate total bill using java swing
- Currency Convertor java project, swing component
- Python Number Guessing Game mini Project
See my more website