Trying to get GUI to print random card in deck using arrayList

后端 未结 3 1431
面向向阳花
面向向阳花 2021-01-17 04:59

So I\'m currently working on a Card War Game in java. I\'m trying to get the GUI screen to print 2 random cards from a set of card images using an arrayList (must use this f

3条回答
  •  没有蜡笔的小新
    2021-01-17 05:40

    You could create a new list like this using .subList(fromIndex, toIndex)

    ArrayList list2= new ArrayList(
    .subList(0,1))
    

提交回复
热议问题