Im trying to create a program which acts like a fruit machine at the moment i am writing an action listener to work with the spin JButton. i have a number of IconImages constructed. could i possibly set these images as an array and then use the random int method to show a random image? if so how do i go about that?
Laidler
0
Junior Poster in Training
Recommended Answers
Jump to PostThe first 6 errors are because you are trying to store icons of type ImageIcon in an int array. You need an ImageIcon array.
The other 3 errors are because fruit1, fruit2 and fruit3 are local variables that exist only while the fm1 constructor is active. Since you want …
All 4 Replies
Laidler
0
Junior Poster in Training
r.stiltskin
eric jim
0
Newbie Poster
Laidler
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.