samedi 22 décembre 2018

How to stop substraction if that is not possible?

Im makeing selling players app for my project, and now i have setted money and i can buy player if i have enough money, but if dont have enough money how to stop substraction?

int a = Integer.parseInt(cijenaIgraca.getText()); int b = Integer.parseInt(kapital.getText());

    String c = String.valueOf(b-a);


    this.kapital.setText(c);

    if(b<a){
        this.porukica.setText("Usli ste u minus, imacete troskove!");



    }

int a = Integer.parseInt(cijenaIgraca.getText()); int b = Integer.parseInt(kapital.getText());

    String c = String.valueOf(b-a);


    this.kapital.setText(c);

    if(b<a){
        this.porukica.setText("Usli ste u minus, imacete troskove!");



    }

Aucun commentaire:

Enregistrer un commentaire