-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyDialog.java
More file actions
34 lines (31 loc) · 872 Bytes
/
MyDialog.java
File metadata and controls
34 lines (31 loc) · 872 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
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
@SuppressWarnings("all")
class MyDialog extends JDialog implements ActionListener
{
JLabel lbl_mesg;
JButton cmd_OK;
public MyDialog(JFrame frame,String mesg,boolean modal)
{
super(frame,mesg,modal);
lbl_mesg=new JLabel(mesg);
cmd_OK=new JButton("OK");
JPanel panel1=new JPanel();
panel1.setLayout(new FlowLayout());
panel1.add(lbl_mesg);
JPanel panel2=new JPanel();
panel2.setLayout(new FlowLayout());
panel2.add(cmd_OK);
getContentPane().setLayout(new BorderLayout());
getContentPane().add(panel1,BorderLayout.CENTER);
getContentPane().add(panel2,BorderLayout.SOUTH);
cmd_OK.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
dispose();
}
}