-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInvalidCodeGui.java
More file actions
34 lines (31 loc) · 962 Bytes
/
InvalidCodeGui.java
File metadata and controls
34 lines (31 loc) · 962 Bytes
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
/* Alec Snyder
* cs162
* A small helper class to display if the user inputs the wrong code for the oauth2 two step verification
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class InvalidCodeGui implements ActionListener
{
public JFrame frame;
public JButton confirm;
public InvalidCodeGui()
{
frame=new JFrame("Invalid Code");
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
confirm=new JButton("ok");
frame.getRootPane().setDefaultButton(confirm);
frame.setLayout(new GridLayout(2,1));
JLabel label=new JLabel("Your Code was invalid, please try again!");
confirm.addActionListener(this);
frame.add(label);
frame.add(confirm);
frame.pack();
frame.setSize(new Dimension(500,500));
frame.setVisible(true);
}
public void actionPerformed(ActionEvent e)
{
frame.dispose();
}
}