-
Notifications
You must be signed in to change notification settings - Fork 0
/
GuideFrame.java
97 lines (69 loc) · 1.81 KB
/
GuideFrame.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
86
87
88
89
90
91
92
93
94
95
96
97
package PeanutCracker;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
/**
* Created with IntelliJ IDEA.
* User: dongcarl
* Date: 2/10/13
* Time: 7:43 PM
* To change this template use File | Settings | File Templates.
*/
public class GuideFrame extends JFrame implements MouseListener
{
// public static void main(String args[])
// {
// GuideFrame n = new GuideFrame(new Rectangle(100, 100, 1000, 1000));
// }
public static JPanel portalPanel;
public GuideFrame()
{
setTitle("Portal");
setSize(510, 95);
setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
// Determine the new location of the window
int w = this.getSize().width;
int h = this.getSize().height;
int x = (dim.width-w)/2;
int y = (dim.height-h)/2;
// Move the window
this.setLocation(x, y);
GuidePanel portalPanel = new GuidePanel();
portalPanel.setName("shit");
add(portalPanel);
for (final JButton j : GuidePanel.bList)
{
j.addMouseListener(this);
}
}
@Override
public void mouseClicked(MouseEvent e)
{
Component theChosenOne = e.getComponent();
System.out.println(theChosenOne.getName());
remove(portalPanel);
GuideChangeSettings guidance = new GuideChangeSettings(theChosenOne.getName());
add(guidance);
}
@Override
public void mousePressed(MouseEvent e)
{
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
public void mouseReleased(MouseEvent e)
{
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
public void mouseEntered(MouseEvent e)
{
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
public void mouseExited(MouseEvent e)
{
}
}