private void btnBracketsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBracketsActionPerformed
        //Surround selected text with paranthesis.
        if (txtExpression.getSelectedText() == null || txtExpression.getSelectedText().isEmpty()) {
            txtExpression.setText("(" + txtExpression.getText() + ")");
        } else {
            int caretPos;
            txtExpression.setText(txtExpression.getText().substring(0, txtExpression.getSelectionStart()) + "(" + txtExpression.getSelectedText() + ")" + txtExpression.getText().substring(caretPos = txtExpression.getSelectionEnd()));
            txtExpression.setCaretPosition(caretPos + 2);
            txtExpression.grabFocus();
        }
    }//GEN-LAST:event_btnBracketsActionPerformed