Home Java Currency Converter Using Java

Currency Converter Using Java

1 min read
0
0
6,366

This tutorial will teach you how to make make a Currency Converter Using Java step by step.

Paste the below the code inside the convert button.

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         

        Double tot; 
        Double amount = Double.parseDouble(txtamount.getText());
        
        if(txtfrom.getSelectedItem().toString() == "USD" && txtto.getSelectedItem().toString() == "Srilankan Rupees")
        {
            tot = amount * 179.50;
            JOptionPane.showMessageDialog(this, "Your Amount will be " + tot.toString());
        }
       else  if(txtfrom.getSelectedItem().toString() == "USD" && txtto.getSelectedItem().toString() == "Indian Rupees")
        {
            tot = amount * 70.50;
            JOptionPane.showMessageDialog(this, "Your Amount will be " + tot.toString());
        }        
    }

i have attached the video link below. which will do this tutorials step by step.

 

  • Java String Methods

    Java provides a rich set of built-in methods for handling String operations efficiently. S…
  • Is Java Hard to Learn?

    Is Java Hard to Learn is it True? Java is one of the most popular programming languages in…
  • How to generate random with weight java

    Generating Random Numbers with Weights in Java Random number generation with weighted prob…
Load More Related Articles
  • Java Beans

    A Java Bean is a reusable software component that follows a specific set of conventions. J…
  • Java String Methods

    Java provides a rich set of built-in methods for handling String operations efficiently. S…
  • Java Developer Jobs

    Java remains one of the most in-demand programming languages worldwide, powering everythin…
Load More By admin
  • Java Beans

    A Java Bean is a reusable software component that follows a specific set of conventions. J…
  • Java String Methods

    Java provides a rich set of built-in methods for handling String operations efficiently. S…
  • Java Developer Jobs

    Java remains one of the most in-demand programming languages worldwide, powering everythin…
Load More In Java

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also

Java Beans

A Java Bean is a reusable software component that follows a specific set of conventions. J…