-
Notifications
You must be signed in to change notification settings - Fork 0
/
Instruction1.java~
54 lines (50 loc) · 1.69 KB
/
Instruction1.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
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
/**
* The is the GoodBye panel that is the outro screen.
*
* @author Eric Tu and Sejin Kwon
* @version 3
* @since June 1 2012
*/
public class Instruction1 extends JPanel implements ActionListener {
/**
* The class constructor.
*
* Adds and creates a message saying bye.
*/
public Instruction1(){
setLayout (null);
JButton back = new JButton (new ImageIcon ("Back.png"));
back.setOpaque (false);
back.setContentAreaFilled (false);
back.setBorderPainted (false);
back.setFocusable (false);
back.setRolloverIcon (new ImageIcon ("Backrollover.png"));
back.setActionCommand ("Back");
JButton next = new JButton (new ImageIcon ("next.png"));
next.setOpaque (false);
next.setContentAreaFilled (false);
next.setBorderPainted (false);
next.setFocusable (false);
next.setRolloverIcon (new ImageIcon ("nextrollover.png"));
next.setActionCommand ("Next");
back.addActionListener (this);
next.addActionListener (this);
JLabel pic = new JLabel(new ImageIcon ("Instructions1.png"));
pic.setBounds (0, 0, pic.getPreferredSize ().width, pic.getPreferredSize ().height);
back.setBounds (5, 200, back.getPreferredSize ().width, back.getPreferredSize ().height);
next.setBounds (450, 200, next.getPreferredSize ().width, next.getPreferredSize ().height);
add (pic);
add (back);
add (next);
}
public void actionPerformed (ActionEvent e)
{
if (e.getActionCommand ().equals ("Back"))
FrameApp.cardLayout.show (FrameApp.mainPanel, FrameApp.MAINMENU);
else
FrameApp.cardLayout.show (FrameApp.mainPanel, FrameApp.INSTRUCTIONS2);
}
}