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

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -