-package hayashi.yuu.tools.gui;
-
-import java.awt.Font;
-import java.awt.Rectangle;
-import java.awt.Toolkit;
-import java.awt.Window;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-
-public class QuitDialog extends JDialog implements WindowListener
-{
- JButton yesButton;
- JButton noButton;
- JLabel label1;
-
- public QuitDialog(JFrame parent, boolean modal) {
- super(parent, modal);
- addWindowListener((WindowListener) this);
- setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
-
- setLayout(null);
- setSize(getInsets().left + getInsets().right + 337, getInsets().top + getInsets().bottom + 135);
-
- yesButton = new JButton(" 終了 ");
- yesButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new WindowEvent((Window)getParent(), 201));
- System.exit(0);
- }
- });
- yesButton.setBounds(getInsets().left + 72, getInsets().top + 80, 79, 22);
- yesButton.setFont(new Font("Dialog", 1, 12));
- add(yesButton);
-
- noButton = new JButton("キャンセル");
- noButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new WindowEvent(QuitDialog.this, WindowEvent.WINDOW_CLOSING));
- setVisible(false);
- }
- });
- noButton.setBounds(getInsets().left + 185, getInsets().top + 80, 99, 22);
- noButton.setFont(new Font("Dialog", 1, 12));
- add(noButton);
-
- label1 = new JLabel("プログラムを終了します。", JLabel.CENTER);
- label1.setBounds(78, 33, 180, 23);
- add(label1);
- setTitle("プログラムの終了");
- setResizable(false);
- setVisible(true);
- }
-
- public void setVisible(boolean b) {
- if(b) {
- Rectangle bounds = getParent().getBounds();
- Rectangle abounds = getBounds();
- setLocation(bounds.x + (bounds.width - abounds.width) / 2, bounds.y + (bounds.height - abounds.height) / 2);
- }
- super.setVisible(b);
- }
-
-
- public void windowActivated(WindowEvent e) {
- }
-
- public void windowClosed(WindowEvent e) {
- setVisible(false);
- }
-
- public void windowClosing(WindowEvent e) {
- setVisible(false);
- }
-
- public void windowDeactivated(WindowEvent e) {
- }
-
- public void windowDeiconified(WindowEvent e) {
- }
-
- public void windowIconified(WindowEvent e) {
- }
-
- public void windowOpened(WindowEvent e) {
- }
-}
+package hayashi.yuu.tools.gui;\r
+\r
+import java.awt.Font;\r
+import java.awt.Rectangle;\r
+import java.awt.Toolkit;\r
+import java.awt.Window;\r
+import java.awt.event.WindowEvent;\r
+import java.awt.event.WindowListener;\r
+\r
+import javax.swing.JButton;\r
+import javax.swing.JDialog;\r
+import javax.swing.JFrame;\r
+import javax.swing.JLabel;\r
+\r
+public class QuitDialog extends JDialog implements WindowListener\r
+{\r
+ JButton yesButton;\r
+ JButton noButton;\r
+ JLabel label1;\r
+\r
+ public QuitDialog(JFrame parent, boolean modal) {\r
+ super(parent, modal);\r
+ addWindowListener((WindowListener) this);\r
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r
+\r
+ setLayout(null);\r
+ setSize(getInsets().left + getInsets().right + 337, getInsets().top + getInsets().bottom + 135);\r
+ \r
+ yesButton = new JButton(" 終了 ");\r
+ yesButton.addActionListener(new java.awt.event.ActionListener() {\r
+ public void actionPerformed(java.awt.event.ActionEvent evt) {\r
+ Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new WindowEvent((Window)getParent(), 201));\r
+ System.exit(0);\r
+ }\r
+ });\r
+ yesButton.setBounds(getInsets().left + 72, getInsets().top + 80, 79, 22);\r
+ yesButton.setFont(new Font("Dialog", 1, 12));\r
+ add(yesButton);\r
+\r
+ noButton = new JButton("キャンセル");\r
+ noButton.addActionListener(new java.awt.event.ActionListener() {\r
+ public void actionPerformed(java.awt.event.ActionEvent evt) {\r
+ Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new WindowEvent(QuitDialog.this, WindowEvent.WINDOW_CLOSING));\r
+ setVisible(false);\r
+ }\r
+ });\r
+ noButton.setBounds(getInsets().left + 185, getInsets().top + 80, 99, 22);\r
+ noButton.setFont(new Font("Dialog", 1, 12));\r
+ add(noButton);\r
+ \r
+ label1 = new JLabel("プログラムを終了します。", JLabel.CENTER);\r
+ label1.setBounds(78, 33, 180, 23);\r
+ add(label1);\r
+ setTitle("プログラムの終了");\r
+ setResizable(false);\r
+ setVisible(true);\r
+ }\r
+\r
+ public void setVisible(boolean b) {\r
+ if(b) {\r
+ Rectangle bounds = getParent().getBounds();\r
+ Rectangle abounds = getBounds();\r
+ setLocation(bounds.x + (bounds.width - abounds.width) / 2, bounds.y + (bounds.height - abounds.height) / 2);\r
+ }\r
+ super.setVisible(b);\r
+ }\r
+\r
+\r
+ public void windowActivated(WindowEvent e) {\r
+ }\r
+\r
+ public void windowClosed(WindowEvent e) {\r
+ setVisible(false);\r
+ }\r
+\r
+ public void windowClosing(WindowEvent e) {\r
+ setVisible(false);\r
+ }\r
+\r
+ public void windowDeactivated(WindowEvent e) {\r
+ }\r
+\r
+ public void windowDeiconified(WindowEvent e) {\r
+ }\r
+\r
+ public void windowIconified(WindowEvent e) {\r
+ }\r
+\r
+ public void windowOpened(WindowEvent e) {\r
+ }\r
+}\r