java - Select Randomly an object from a list (Image) -


guys wondering if way put list of example jlabels, , method select randomly 1 of them.

and if jlabels images still work??

thanks answers;)

yes it's possible:

random r = new random();         list<jlabel> yourlist; //populate list beforehand. yourlist.add(jlabel blah); , on         jlabel randomjlabel = yourlist.get(r.nextint(yourlist.size())); 

Popular posts from this blog

javascript - Js, document.getElementById("ID").innerHTML, error -

jquery - jqGrid update specific column data with out refreshing the entire column? -

objective c - Is there a way in OCMockito to make stubs fail when an unknown method is called? -