Question

I'm trying to generate a random number and if the value gotten from the jtable is a hyphen I want it to random again. I'm doing a do while loop however none of these while loops are working. I dont know what i'm missing? EDIT: Whoops I found out my fault, my action listener was running the wrong method that I created, thanks for help

Était-ce utile?

La solution

Make your parenthesis proper like below and run

randomNum = (int)(Math.random() * (stuTable.getRowCount() - 1));

check it out

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top