public void mainButtonAction() {
        if (!textField1.getText().equals(null) && !textField1.getText().equals("") && !textField2.getText().equals(null) && !textField2.getText().equals("")) {
            boolean result = false;
            long startTime,endTime;
            if ( validateTextFields() == true ) {
                if (radioButton1.isSelected()) {
                    textArea.setText("");
                    startTime = System.nanoTime();
                    result = fermat.probablyPrime(readValue(), readAttempts(), isEnhancedVerbosity.isSelected());
                    endTime = System.nanoTime();
                    textArea.setText(textArea.getText()+"\n"+
                                    "execution time: "+(endTime-startTime)/1000000000.0);
                } else if (radioButton2.isSelected()) {
                    textArea.setText("");
                    startTime = System.nanoTime();
                    result = solovayStrassenPrimalityTest.probablyPrime(readValue(), readAttempts(), isEnhancedVerbosity.isSelected());
                    endTime = System.nanoTime();
                    textArea.setText(textArea.getText()+"\n"+
                            "execution time: "+(endTime-startTime)/1000000000.0);
                } else {
                    textArea.setText("Select algorithm to validate prime number\n");
                }
            } else {
                textArea.setText("Given parameters are incorrect\n");
            }
        } else {
            textArea.setText("Provide number to validate\n");
        }
    }