- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyDialog.java
More file actions
Latest commit
34 lines (31 loc) · 872 Bytes
/
Copy pathMyDialog.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
importjava.io.*;
importjava.awt.*;
importjava.awt.event.*;
importjavax.swing.*;
importjava.util.*;
@SuppressWarnings("all")
classMyDialogextendsJDialogimplementsActionListener
{
JLabellbl_mesg;
JButtoncmd_OK;
publicMyDialog(JFrameframe,Stringmesg,booleanmodal)
{
super(frame,mesg,modal);
lbl_mesg=newJLabel(mesg);
cmd_OK=newJButton("OK");
JPanelpanel1=newJPanel();
panel1.setLayout(newFlowLayout());
panel1.add(lbl_mesg);
JPanelpanel2=newJPanel();
panel2.setLayout(newFlowLayout());
panel2.add(cmd_OK);
getContentPane().setLayout(newBorderLayout());
getContentPane().add(panel1,BorderLayout.CENTER);
getContentPane().add(panel2,BorderLayout.SOUTH);
cmd_OK.addActionListener(this);
}
publicvoidactionPerformed(ActionEventae)
{
dispose();
}
}