English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Currently, i am working on a memory game.
But i have encountered some problems.
I need to display an image on the JButton when i click on the JButton.
But whenever i clicked on it, nothing appear.
What am i suppose to add in my source code.

Another problem is that how do i randomize images in the memory game so that whenever a new game started, the images will change their position.

2006-07-20 22:44:27 · 1 answers · asked by Stress 1 in Computers & Internet Programming & Design

1 answers

You need
public JButton(Icon icon)

and

public static double random()
Returns:
a pseudorandom double greater than or equal to 0.0 and less than 1.0. use time, seconds or micro seconds to make more random.

2006-07-21 00:02:11 · answer #1 · answered by AnalProgrammer 7 · 0 0

fedest.com, questions and answers