Hi,
Having problem here with my program. The number shown in the CM box always jumped to show same result as the output (inch box) during converting but there is no problem when convert from inch to cm. Anyone help to debug on my source code?

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.text.DecimalFormat;


public class MetricConverter extends JFrame {

private JButton btnDivide, btnMultiply;
private JTextField txtNum1, txtNum2;
private JLabel lab1Cm, lab2Inches;


public MetricConverter() {
setSize(400, 180);
setTitle("ABC Metric Converter");
setVisible(true);

JPanel contentPane = (JPanel)this.getContentPane();
contentPane.setLayout(null);

btnDivide = new JButton(">");
btnDivide.setBounds(new Rectangle(100, 20, 50, 30));
contentPane.add(btnDivide);
btnMultiply = new JButton("<");
btnMultiply.setBounds(new Rectangle(100, 50, 50, 30));
contentPane.add(btnMultiply);
txtNum1 = new JTextField("0");
txtNum1.setBounds(new Rectangle(10, 30, 50, 20));
contentPane.add(txtNum1);

txtNum2 = new JTextField("0");
txtNum2.setBounds(new Rectangle(170, 30, 50, 20));
contentPane.add(txtNum2);
lab1Cm = new JLabel("cm");
lab1Cm.setBounds(new Rectangle(65, 30, 40,20));
contentPane.add(lab1Cm);
lab2Inches = new JLabel("Inches");
lab2Inches.setBounds(new Rectangle(230, 30, 40,20));
contentPane.add(lab2Inches);

AHandler handle = new AHandler();
btnDivide.addActionListener(handle);
btnMultiply.addActionListener(handle);
}
public static void main(String[] args) {
MetricConverter myFrame = new MetricConverter();
}

class AHandler implements ActionListener {
public void actionPerformed(ActionEvent e) {
double num1 = Double.parseDouble(txtNum1.getText());
double num2 = Double.parseDouble(txtNum2.getText());
double answer = 0;



if (e.getSource() == btnDivide) {
answer = num1 / 2.54;
txtNum2.setText(" " + fmt.format(answer));

}
else
answer = num2 * 2.54;
txtNum1.setText(" " + fmt.format(answer));


}

DecimalFormat fmt = new DecimalFormat("0.#");

// if (e.getSource() == btnMultiply) {
// answer = num2 * 2.54;
// txtNum1.setText(" " + fmt.format(answer));

// }
// else
// answer = num1 / 2.54;
// txtNum2.setText(" " + fmt.format(answer));


}
}