Domanda

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

È stato utile?

Soluzione

Make your parenthesis proper like below and run

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

check it out

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top