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

有帮助吗?

解决方案

Make your parenthesis proper like below and run

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

check it out

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top