I looked at your code. TheTextFiled handler you have registered with textField only invoked when you press enter key on text field.
TextFieldHandler handler = new TextFieldHandler();
textField.addActionListener(handler);
Therefore actionPerformed in TextFieldHandler only invoked if you press enter on textField and that moment only your insurancevaluetextField read and set to value.
You can either change the listener so that text filed key change will capture value or just add textfiled read logic into calculate button listener. i.e DoListener
private class DoListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
DecimalFormat df = new DecimalFormat("0.00");
String weightStr = textField.getText();
weight = Double.parseDouble(weightStr);
String valueStr = insurancevaluetextField.getText();
value = Double.parseDouble(valueStr);
.... }
I would suggest the changing DoListener.
when you are using API read about it. Know what they do exactly. Also debug the program using good IDE. You will spot the error very quickly.