Results 1 to 3 of 3
  1. #1
    Pascal Nouma is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Default Currency Converter!!!!

    Hey everyone,*

    I've an assignment that is coding a "currency converter". I managed to generate the program screen, but I don't know where and how to code in order to make calculations for currency conversion. If you've any solution or idea about it, please leave your comments on that topic page..

    Thanks a lot for everything from now on.

    Have a nice Sunday!!!!

    package assignment;

    import java.awt.Container;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;

    import java.text.DecimalFormat;

    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTextField;

    public class MoneyConverter extends JFrame {

    private JFrame mainFrame;
    private JLabel inLabel;
    private JTextField inField;
    private JLabel tinLabel;
    private JTextField tinField;
    private JLabel zinLabel;
    private JTextField zinField;
    private JButton closeButton;
    private JButton usdtoaudButton;
    private JButton audtousdButton;

    public MoneyConverter() {


    mainFrame = new JFrame("Money Converter");
    inLabel = new JLabel(" AUD ");
    inField = new JTextField(20);
    tinLabel = new JLabel(" Rate ");
    tinField = new JTextField(20);
    zinLabel = new JLabel(" USD ");
    zinField = new JTextField(20);
    usdtoaudButton = new JButton("USD to AUD");
    audtousdButton = new JButton("AUD to USD");
    closeButton = new JButton("Close");

    Container c = mainFrame.getContentPane();
    c.setLayout(new FlowLayout());


    c.add(inLabel);
    c.add(inField);
    c.add(tinLabel);
    c.add(tinField);
    c.add(zinLabel);
    c.add(zinField);
    c.add(usdtoaudButton);
    c.add(audtousdButton);
    c.add(closeButton);

    mainFrame.setSize(400,180);

    mainFrame.addWindowListener(new WindowAdapter()
    {
    public void windowClosing(WindowEvent e) {System.exit(0);
    }
    });

    USDtoAUDButtonHandler uhandler = new USDtoAUDButtonHandler();
    usdtoaudButton.addActionListener(uhandler);
    CloseButtonHandler chandler = new CloseButtonHandler();
    closeButton.addActionListener(chandler);
    AUDtoUSDButtonHandler ahandler = new AUDtoUSDButtonHandler();
    audtousdButton.addActionListener(ahandler);

    mainFrame.show();
    }

    class USDtoAUDButtonHandler implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    System.exit(0);
    }
    }

    class AUDtoUSDButtonHandler implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    System.exit(0);
    }
    }

    class CloseButtonHandler implements ActionListener
    {
    public void actionPerformed(ActionEvent e)
    {
    System.exit(0);
    }
    }
    public static void main(String args [])
    {
    MoneyConverter app = new MoneyConverter();

    }


    }

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,236
    Rep Power
    19

    Default

    Still cross posting.
    Swing - CURRENCY CONVERTER!!!!

    db

  3. #3
    finzaiko is offline Member
    Join Date
    Jan 2009
    Posts
    6
    Rep Power
    0

    Default

    anyone know how convert with comma?
    103.5 = ten hundred point five

    when i put 103.5 in jtextfield show on jlabel "ten hundred point five"

    Thanks,
    Finz

Similar Threads

  1. Convert Currency to Words in English
    By javanewbie in forum JCreator
    Replies: 5
    Last Post: 03-29-2009, 07:25 AM
  2. usb to serial converter
    By freezy in forum Advanced Java
    Replies: 2
    Last Post: 03-18-2009, 10:48 AM
  3. sound converter WAV to AU
    By Unome in forum Java Applets
    Replies: 5
    Last Post: 03-14-2009, 10:25 AM
  4. Formatting a number to currency
    By Java Tip in forum java.text
    Replies: 0
    Last Post: 04-16-2008, 10:59 PM
  5. Setting currency
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-16-2007, 02:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •