//과제 : 힌번클릭 a 두번 b 세번 c 네번 d
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Main extends JFrame{
private JLabel le=new JLabel("a");
public Main(){
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container c=getContentPane();
le.addMouseListener(new MyMouseListener());
c.setLayout(null);
le.setSize(10,10);
le.setLocation(100,100);
c.add(le);
setSize(300,300);
setVisible(true);
}
class MyMouseListener extends MouseAdapter{
public void mouseClicked(MouseEvent e) {
le.setLayout(null);
int x = (int)(Math.random()*300);
int y = (int) (Math.random()*300);
le.setLocation(x, y);
for(int i=0;i<3;i++) {
if(e.getClickCount() == i) {
}
}
}
}
public static void main(String[] args) {
new Main();
}
}