-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindowErrMsg.java
More file actions
74 lines (68 loc) · 1.98 KB
/
WindowErrMsg.java
File metadata and controls
74 lines (68 loc) · 1.98 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
package traintransfer;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextPane;
import java.awt.Color;
import java.awt.SystemColor;
import javax.swing.JTextArea;
public class WindowErrMsg extends JDialog {
/**
*
*/
private static final long serialVersionUID = 1537831677453453742L;
private final JPanel contentPanel = new JPanel();
JTextArea textArea;
/**
* Launch the application.
*/
public static void main(String[] args) {
try {
WindowErrMsg dialog = new WindowErrMsg();
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Create the dialog.
*/
public WindowErrMsg() {
setBounds(100, 100, 450, 215);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(null);
textArea = new JTextArea();
textArea.setFont(new Font("Monospaced", Font.PLAIN, 14));
textArea.setEditable(false);
textArea.setWrapStyleWord(true);
textArea.setLineWrap(true);
textArea.setBackground(SystemColor.menu);
textArea.setBounds(10, 10, 416, 125);
contentPanel.add(textArea);
{
JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
getContentPane().add(buttonPane, BorderLayout.SOUTH);
{
JButton cancelButton = new JButton("È·¶¨");
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dispose();
}
});
cancelButton.setActionCommand("Cancel");
buttonPane.add(cancelButton);
}
}
}
}