-
Notifications
You must be signed in to change notification settings - Fork 1
/
CorrectPanel.java~
executable file
·41 lines (28 loc) · 1.02 KB
/
CorrectPanel.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
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class CorrectPanel extends JPanel {
private JLabel youWin;
private JButton nextLevel;
private ImageIcon winImg,nextLevelImg;
public CorrectPanel(){
setLayout (new GridLayout(2,1));
setBackground(new Color(255, 222, 156));
winImg = new ImageIcon("youWin.gif");
youWin = new JLabel(winImg);
nextLevelImg = new ImageIcon("nextLevel.gif");
nextLevel = new JButton(nextLevelImg);
nextLevel.addActionListener(new ActionListener() { // Show "PlayPanel at Level 1" panel when button is clicked
// @Override
public void actionPerformed(ActionEvent arg0) {
TuneInGUI.cl.show(TuneInGUI.cards, "Play Panel");
PlayPanel.setLevel((PlayPanel.getLevel())+1); // go to next Level
}
});
nextLevel.setBorder(null);
nextLevel.setMargin(new Insets(0, 0, 0, 0));
// create and instantiate the icons later
add(youWin);
add(nextLevel);
}
}