I have created a matrix of JButtons in a JFrame using the GUI of NetBeans. I want to select them randomly, but I don't have any idea how to do it. Any idea will help. Thanks.
Having the list of JButtons.
Simply pick one random from it with the
Random rnd = new Random(); int i = rnd.nextInt(buttons.size()); JButton btn = buttons.get(i);
Works on the same logic like arrays.