View Javadoc

1   /**
2      This file is part of GoldenGate Project (named also GoldenGate or GG).
3   
4      Copyright 2009, Frederic Bregier, and individual contributors by the @author
5      tags. See the COPYRIGHT.txt in the distribution for a full listing of
6      individual contributors.
7   
8      All GoldenGate Project is free software: you can redistribute it and/or 
9      modify it under the terms of the GNU General Public License as published 
10     by the Free Software Foundation, either version 3 of the License, or
11     (at your option) any later version.
12  
13     GoldenGate is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17  
18     You should have received a copy of the GNU General Public License
19     along with GoldenGate .  If not, see <http://www.gnu.org/licenses/>.
20   */
21  package openr66.r66gui;
22  
23  import java.awt.BorderLayout;
24  import java.awt.FlowLayout;
25  import java.awt.GridLayout;
26  import java.awt.event.ActionEvent;
27  import java.awt.event.ActionListener;
28  
29  import javax.swing.JButton;
30  import javax.swing.JDialog;
31  import javax.swing.JEditorPane;
32  import javax.swing.JPanel;
33  import javax.swing.JScrollPane;
34  import javax.swing.border.EmptyBorder;
35  
36  /**
37   * @author Frederic Bregier
38   *
39   */
40  public class R66Dialog extends JDialog {
41  
42      /**
43       * 
44       */
45      private static final long serialVersionUID = -6105635300084413738L;
46      private final JPanel contentPanel = new JPanel();
47      public JEditorPane textPaneDialog;
48  
49      /**
50       * Create the dialog.
51       */
52      public R66Dialog() {
53          setTitle("R66 Gui Dialog");
54          setBounds(100, 100, 426, 298);
55          getContentPane().setLayout(new BorderLayout());
56          contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
57          getContentPane().add(contentPanel, BorderLayout.CENTER);
58          contentPanel.setLayout(new GridLayout(1, 0, 0, 0));
59          {
60              JScrollPane scrollPane = new JScrollPane();
61              contentPanel.add(scrollPane);
62              {
63                  textPaneDialog = new JEditorPane();
64                  scrollPane.setViewportView(textPaneDialog);
65                  textPaneDialog.setEditable(false);
66                  textPaneDialog.setContentType("text/html");
67              }
68          }
69          {
70              JPanel buttonPane = new JPanel();
71              buttonPane.setLayout(new FlowLayout(FlowLayout.CENTER));
72              getContentPane().add(buttonPane, BorderLayout.SOUTH);
73              {
74                  JButton okButton = new JButton("OK");
75                  okButton.addActionListener(new ActionListener() {
76                      public void actionPerformed(ActionEvent e) {
77                          R66ClientGui.window.enableAllButtons();
78                          dispose();
79                      }
80                  });
81                  okButton.setActionCommand("OK");
82                  buttonPane.add(okButton);
83                  getRootPane().setDefaultButton(okButton);
84              }
85          }
86          this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
87      }
88  
89  }