-
Notifications
You must be signed in to change notification settings - Fork 0
/
Appli.java
91 lines (53 loc) · 1.59 KB
/
Appli.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package proj;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.imageio.*;
import java.awt.image.*;
class Appli extends JFrame implements MouseListener {
JLabel statusLabel = new JLabel();
public Appli() {
this.setTitle("CampusMap by 윤서, 예은");
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setBounds(0, 0, 971, 758);
statusLabel.setBounds(0, 0, 1813, 1053);
statusLabel.setIcon(new ImageIcon(CampusMap.class.getResource("텀프로젝트.jpg")));
statusLabel.setForeground(new Color(0, 0, 0));
this.getContentPane().add(statusLabel);
this.addMouseListener(this);
this.setVisible(true);
}
@Override
public void mouseClicked(MouseEvent me) {
System.out.println("마우스 X좌표 : " + me.getX());
System.out.println("마우스 Y좌표 : " + me.getY());
int xx = Integer.valueOf(me.getX());
int yy = Integer.valueOf(me.getY());
System.out.println("xx : " + xx +" "+ yy);
if(xx >= 644 && xx <= 898 && yy >= 407 && yy <= 678) {
CampusMap cm = new CampusMap();
cm.show();
dispose();
}
}
@Override
public void mouseEntered(MouseEvent me) {
System.out.println("mouseEtered");
}
@Override
public void mouseExited(MouseEvent me) {
System.out.println("mouseExit");
}
@Override
public void mousePressed(MouseEvent me) {
System.out.println("mousePress");
}
@Override
public void mouseReleased(MouseEvent me) {
System.out.println("mouseReleased");
}
public static void main(String[] args) {
Appli app = new Appli();
}
}