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

Was it helpful?

Solution

Make your parenthesis proper like below and run

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

check it out

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top