/**
 * Part of Employ
 */

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;

public class DashboardFrame extends CommonFrame implements ActionListener {

  JButton buttonAddData = new JButton("Add");
  JButton buttonDeleteData = new JButton("Delete");
  JButton buttonClearData = new JButton("Clear");
  JTextField textNumberInput = new JTextField(20);
  JTextField textNumberOutput = new JTextField(20);

  int numberInput;

  // define dashboard for special frame
  public DashboardFrame() {
    super("Dashboard");

    buttonAddData.setActionCommand("addData");
    buttonDeleteData.setActionCommand("deleteData");
    buttonClearData.setActionCommand("clearData");

    buttonAddData.addActionListener(this);
    buttonDeleteData.addActionListener(this);
    buttonClearData.addActionListener(this);
    textNumberOutput.setEditable(false);

    add(buttonAddData);
    add(buttonDeleteData);
    add(buttonClearData);
    add(textNumberInput);
    add(textNumberOutput);
  }

  // get number input in text input
  // also define exception if input is not number
  void getNumberInput() {
    String numberInputString = textNumberInput.getText();
    try {
      numberInput = Integer.parseInt(numberInputString);
      textNumberOutput.setText(numberInput + "");
    } catch (Exception ex) {
      textNumberOutput.setText("Type number!");
    }
  }

  // clear number output in text output
  void clearNumberOutput() {
    textNumberOutput.setText("");
  }

  // clear number input & output in text input & output
  void clearNumberInputOutput() {
    textNumberInput.setText("");
    textNumberOutput.setText("");
  }

  // give warning message in text output if number input is empty
  void warnInputNumber() {
    textNumberOutput.setText("Type number!");
  }

  // define listener action when button is clicked
  public void actionPerformed(ActionEvent event) {
    if (event.getActionCommand().equals("addData")) {
      if (textNumberInput.getText().equals("")) {
        warnInputNumber();
      } else {
        getNumberInput();
      }
    } else if (event.getActionCommand().equals("deleteData")) {
      clearNumberOutput();
    } else if (event.getActionCommand().equals("clearData")) {
      clearNumberInputOutput();
    } else {
      textNumberOutput.setText("Use the button!");
    }

    repaint();
  }

}

@@ -384,25 +384,25 @@
  JTextField(
-2
+3
 0);%0A  JTextF
@@ -444,19 +444,22 @@
 eld(
-2
+3
 0);%0A%0A  
-int
+double
  num
@@ -466,16 +466,85 @@
 berInput
+ = 0;%0A  String warnInputNumber = %22Type number (dot-decimal notation)%22
 ;%0A%0A  // 
@@ -1298,24 +1298,26 @@
 t = 
-Integer.parseInt
+Double.parseDouble
 (num
@@ -1439,38 +1439,39 @@
 put.setText(
-%22Type n
+warnInputN
 umber
-!%22
 );%0A    %7D%0A  %7D
@@ -1868,22 +1868,23 @@
 ext(
-%22Type n
+warnInputN
 umber
-!%22
 );%0A 

Use double type for number and warn if not