-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rune.java
29 lines (27 loc) · 908 Bytes
/
Rune.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
import javax.swing.ImageIcon;
import javax.swing.JPanel;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.MouseEvent;
import java.awt.event.MouseAdapter;
public class Rune extends JPanel {
private ImageIcon runeIcon = new ImageIcon("Resource/rune1.png");
private Image runeImg =new ImageIcon("Resource/rune1.png").getImage();
private ItemListPanel itemList;
public Rune(ItemListPanel itemList){
this.setLayout(null);
this.setBounds(0,0,1000,600);
this.addMouseListener(new PreviousHandler());
}
@Override
public void paintComponent(Graphics g){
super.paintComponent(g);
g.drawImage(runeImg,0,0,this.getWidth(),564,null);
}
private class PreviousHandler extends MouseAdapter{
@Override
public void mouseClicked(MouseEvent e){
GamePanel.changePreviousPanel();
}
}
}