-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemoveController.java
More file actions
52 lines (42 loc) · 1.13 KB
/
RemoveController.java
File metadata and controls
52 lines (42 loc) · 1.13 KB
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
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class RemoveController implements MouseListener
{
private Teacher loggedInTeacher;
private String studentToRemove;
private JButton bt;
private FrameModel model;
public RemoveController(JButton button, FrameModel md, String name, Teacher currentTeacher)
{
this.bt=button;
this.model=md;
this.loggedInTeacher=currentTeacher;
this.studentToRemove = name;
}
public void mouseEntered(MouseEvent e)
{
bt.setOpaque(true);
bt.setForeground(new Color(241,248,108));
bt.setBorder(BorderFactory.createRaisedBevelBorder());
bt.setBackground(Color.BLACK);
}
public void mouseExited(MouseEvent e)
{
bt.setOpaque(true);
bt.setBackground(new Color(241,248,108));
bt.setBorder(BorderFactory.createRaisedBevelBorder());
bt.setForeground(Color.BLACK);
}
public void mouseReleased(MouseEvent e)
{
}
public void mousePressed(MouseEvent e)
{
}
public void mouseClicked(MouseEvent e)
{
this.loggedInTeacher.removeStudent(this.studentToRemove);
this.model.switchPanel("TeacherDashboard3");
}
}