-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfirm.java
More file actions
executable file
·43 lines (41 loc) · 1.14 KB
/
Confirm.java
File metadata and controls
executable file
·43 lines (41 loc) · 1.14 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
import java.awt.*;
import java.awt.event.*;
import javax.swing.border.*;
import javax.swing.*;
class Confirm implements ActionListener
{
JFrame frame;
JLabel stmsg;
JButton ok;
JPanel okpane,stspane;
Confirm()
{
frame=new JFrame("Order Confirmation");
ok=new JButton("Return to Menu");
stmsg=new JLabel("Order Status:BLOC --> SCHD");
stspane=new JPanel();
stspane.setBackground(Color.green);
stspane.setLayout(new GridLayout(1,1));
stspane.add(stmsg);
stmsg.setFont(new Font("Arial", Font.ITALIC, 30));
ok.setFont(new Font("Arial", Font.ITALIC, 20));
ok.addActionListener(this);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocation(dim.width/2-frame.getSize().width/2, dim.height/2-frame.getSize().height/2);
frame.setResizable(false);
frame.setLayout(new GridLayout(2,1));
frame.setSize(450,300);
frame.add(stspane);
frame.add(ok);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==ok)
{frame.dispose();}
}
public static void main(String[] args) {
new Confirm();
}
}