Currency Converter Project In Java With Source Code

What is the Currency Converter Project In Java?

The Currency Converter Project In Java is a piece of software that allows you to convert currency values quickly and easily using current exchange rates.

These currency converters are commonly accessed for free on the Internet, and they can swiftly convert the value of one currency to another, such as dollars to pesos or peso to pounds, and back.

This Currency Converter In Java is useful for learning new skills and practicing Java Desktop Application development.

This project is quite useful, and the concept and logic of the project are simple to grasp. The source code is open source and free to use. Simply scroll down and click the download option.

Currency Converter Project In Java: Project Output

Currency Converter Project
Currency Converter Project
Currency Converter Project Result
Currency Converter Project Result

How to use the Currency Converter Project In Java?

This Currency Converter In Java Code is really simple to use; all you have to do is enter a number into the system’s input field, and once it has a data set, all you have to do is click the button to view the results.

Benefits of Currency Converter Project In Java

The Currency Converter Using Java always has the most up-to-date rate of exchange, leaving no opportunity for errors. To the best of our knowledge, no currency exchange or transaction can be completed without the use of a good currency converter.

Currency converters are useful, simple, accurate, and quick to use in any situation because the user has it either directly on his computer system, giving him or her quick and real-time access to doing business within and outside the country without the risk of making a human error, which is a common occurrence in most of these transactions.

currency converters may be relied upon for reliable and timely information. The ability to offer information in real time is dependable.

These systems provide an easy-to-navigate, appealing, and simple-to-use interface that displays the most up-to-date information on foreign currencies and precious metals. All of this data can even be tracked in real-time for users.

About the Project: Currency Converter Project In Java With Source Code

The Currency Converter Project In Java With Source Code is a simple desktop application made using the Java programming language.

We may also create highly fascinating applications with the Java programming language. The Currency Converter is one of them.

The project system file comprises resource files as well as a Javascript. The User Interface of the system is smooth and simple.

This Code For Currency Converter In Java includes a tutorial and a code development guide. This is a simple and basic-level little project for learning purposes.

Currency Converter is open source, so you can download the zip file and change it to fit your needs. You can also customize this project to meet your needs and create a fantastic advanced-level project.

Project Details and Technology: Currency Converter Project In Java

Project Name:Currency Converter Project In Java
Abstract:This Currency Converter Project In Java is a simple system that converts money from different currencies. It is also for students that need this kind of Java project.
Language/s Used:Java Swing
Java Version (Recommended):11.2
Type:Desktop Application
Developer:Source Code Hero
Updates:0
Currency Converter Project In Java With Source Code – Project Information

The code given below is the full source code on How To Make Currency Converter In Java

The given code below is a Java file for CurrencyConverter.java

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package currencyconverterjava;

import javax.swing.JOptionPane;

/**
 *
 * @author HTCA
 */
public class CurrencyConverter extends javax.swing.JFrame {

    /**
     * Creates new form CurrencyConverter
     */
    public CurrencyConverter() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        jComboBox2 = new javax.swing.JComboBox<>();
        jPanel1 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        txtAmount = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        Convert = new javax.swing.JButton();
        txtFrom = new javax.swing.JComboBox<>();
        txtTo = new javax.swing.JComboBox<>();

        jComboBox2.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jButton1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jButton1.setText("Currency Converter");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        txtAmount.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtAmountActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel1.setText("Amount");

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel2.setText("From");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel3.setText("To");

        Convert.setBackground(new java.awt.Color(255, 204, 102));
        Convert.setText("Convert");
        Convert.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ConvertActionPerformed(evt);
            }
        });

        txtFrom.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "USD", "PHP" }));
        txtFrom.setToolTipText("");

        txtTo.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "PHP", "USD" }));
        txtTo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtToActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(35, 35, 35)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtAmount)
                            .addComponent(txtFrom, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(txtTo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(151, 151, 151)
                        .addComponent(Convert, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(125, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtAmount, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtFrom, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(txtTo)
                        .addGap(18, 18, 18)))
                .addGap(78, 78, 78)
                .addComponent(Convert, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(23, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>                        

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
    }                                        

    private void txtAmountActionPerformed(java.awt.event.ActionEvent evt) {                                          
        // TODO add your handling code here:
    }                                         

    private void ConvertActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        Double convert;
        Double amount = Double.parseDouble(txtAmount.getText());
        
        if(txtFrom.getSelectedItem().toString()=="USD" && txtTo.getSelectedItem().toString()=="PHP"){
            convert = amount * 52;
            JOptionPane.showMessageDialog(this, "The amount is: "+convert.toString()+" PHP");
        }
        else if(txtFrom.getSelectedItem().toString()=="PHP" && txtTo.getSelectedItem().toString()=="USD"){
            convert = amount * 0.019;
            JOptionPane.showMessageDialog(this, "The amount is: "+convert.toString()+" USD");
        }
        
    }                                       

    private void txtToActionPerformed(java.awt.event.ActionEvent evt) {                                      
        // TODO add your handling code here:
    }                                     

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(CurrencyConverter.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(CurrencyConverter.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(CurrencyConverter.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(CurrencyConverter.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new CurrencyConverter().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify                     
    private javax.swing.JButton Convert;
    private javax.swing.JButton jButton1;
    private javax.swing.JComboBox<String> jComboBox2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JTextField txtAmount;
    private javax.swing.JComboBox<String> txtFrom;
    private javax.swing.JComboBox<String> txtTo;
    // End of variables declaration                   
}

This Currency Converter Project In Java With Source Code also includes a downloadable Project With Source Code for free, just find the downloadable source code below and click to start downloading.

To start executing a Java Project, makes sure that you have  NetBeans IDE or any platform of Java installed in your computer.

Currency Converter Project In Java: Steps on how to run the project

Time needed: 5 minutes

These are the steps on how to run a Currency Converter Project In Java

  • Step 1: Download Source Code

    First, find the downloadable source code below and click to start downloading the source code file.
    Currency Converter Project In Java

  • Step 2 : Extract File

    Next, after finished to download the file, go to file location and right click the file and click extract.
    customer management system in php

  • Step 3: Click open project.

    Next, open NetBeans IDE and click open project, and choose your download source code.
    Currency Converter Project In Java Open Project

  • Step 4: Run the project.

    Next, right-click the project folder and click run.
    Currency Converter Project In Java Run Project

Download Source Code below!

Summary

The Java Project With Source Code is built fully in Java. It has a full-featured Graphical User Interface (GUI) with all the functionalities

This article is a way to enhance and develop our skills and logic ideas which is important in practicing the Java programming language which is the most well-known and most usable programming language in many companies.

This Simple Project also includes a downloadable source code for free.

Inquiries

If you have any questions or suggestions about the Currency Converter Project In Java With Source Code, please feel free to leave a comment below.

Leave a Comment