Lets say I have an array of {0,1,2} an I draw a random number.
(可以说我有一个{0,1,2}的数组,我画了一个随机数。)
If random number is 2 for example I want public void mouseClicked(MouseEvent e){... to do code...} the code inside this to work. (例如,如果随机数是2,则我想让public void mouseClicked(MouseEvent e){...做代码...}里面的代码起作用。)
Any way to make it possible? (有什么办法可以实现?)
JLabel lblNewLabel = new JLabel("");
lblNewLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
//to do code
}
});
ask by Sosruko Gorgasali translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…