private void btnDectoBinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDectoBinActionPerformed
        // TODO add your handling code here:
        String y = "";
        String a = JOptionPane.showInputDialog("Enter number here to convert into Binary");
        int x = Integer.parseInt(a);
        int num = x;
        
        while (num>0)
        {
            int z = num % 2;
            y = " " + z + y;
            num = (num - z) / 2;
        }


        JOptionPane.showMessageDialog(null, "The result is: " + y);
    if(a == null || y == null){
            System.out.println("Cancel presed");

    }
    }//GEN-LAST:event_btnDectoBinActionPerformed