I want my program to show seven random numbers, but it does only display one. I got this in a class:
if (command.equals("Random numbers")) { int tal = modell.getTal(); vy.skrivNyLottorad(tal); }
getTal is in the class Model:
public class Model { private int tal; public int getTal() { Random randomNr = new Random(); for (int i = 0; i < 7; i++) { tal = randomNr.nextInt(35); } return tal; }
The method skrivNyLottorad from the first piece of code is here:
public void skrivNyLottorad(int lottorad) { textruta.append(lottorad + "\n"); }
What is my problem? it should display seven numbers, but it does only display one.