-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSupport.java
More file actions
79 lines (58 loc) · 1.68 KB
/
Copy pathSupport.java
File metadata and controls
79 lines (58 loc) · 1.68 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
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
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
public class Support extends JFrame implements ActionListener{
JButton button1;
JButton button2;
JButton button3;
JButton button4;
String userInfo;
public Support(String userinfo){
super("Support");
setLayout(new GridLayout(7, 1));
userInfo=userinfo;
JLabel space1 = new JLabel("");
add(space1);
button1 = new JButton("Account not recharged?");
add(button1);
button1.addActionListener(this);
button2 = new JButton("Electric meter not working?");
add(button2);
button2.addActionListener(this);
button3 = new JButton("Others");
add(button3);
button3.addActionListener(this);
JLabel space2 = new JLabel("");
add(space2);
button4 = new JButton("BACK");
add(button4);
button4.addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
if(e.getSource()==button1) {
this.showMessage();
}
if(e.getSource()==button2) {
this.showMessage();
}
if(e.getSource()==button3) {
this.showMessage();
}
if(e.getSource()==button4) {
this.setVisible(false);
MainPage J = new MainPage(userInfo);
J.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
J.setSize(500, 250);
J.setVisible(true);
}
}
public void showMessage() {
JOptionPane.showMessageDialog(null, "Please Call: 01587-942130", "Support", JOptionPane.PLAIN_MESSAGE);
}
}