View Javadoc

1   /*
2    * $Id: SelectFileDialog.java 178 2010-10-31 18:01:20Z roland $ Copyright (C) 2007 Roland Krueger Created on 17.06.2007 Author: Roland Krueger
3    * (www.rolandkrueger.info) This file is part of RoKlib. This library is free software; you can
4    * redistribute it and/or modify it under the terms of the GNU Lesser General Public License as
5    * published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
6    * any later version. This library is distributed in the hope that it will be useful, but WITHOUT
7    * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8    * PURPOSE. See the GNU Lesser General Public License for more details. You should have received a
9    * copy of the GNU Lesser General Public License along with this library; if not, write to the Free
10   * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
11   */
12  package info.rolandkrueger.demo.tstmap;
13  
14  import java.awt.BorderLayout;
15  import java.awt.Color;
16  import java.awt.Font;
17  import java.awt.Frame;
18  import java.awt.event.ActionEvent;
19  import java.awt.event.ActionListener;
20  
21  import javax.swing.BorderFactory;
22  import javax.swing.JButton;
23  import javax.swing.JDialog;
24  import javax.swing.JPanel;
25  import javax.swing.JTextField;
26  import javax.swing.border.EtchedBorder;
27  import javax.swing.border.TitledBorder;
28  
29  public class SelectFileDialog extends JDialog implements ActionListener
30  {
31    private static final long serialVersionUID = 1L;
32    private JPanel jContentPane = null;
33    private JPanel jPanel = null;
34    private JTextField jTextField = null;
35    private JButton jButton = null;
36  
37    /**
38     * @param owner
39     */
40    public SelectFileDialog (Frame owner)
41    {
42      super (owner);
43      initialize ();
44    }
45  
46    /**
47     * This method initializes this
48     */
49    private void initialize ()
50    {
51      this.setSize (575, 87);
52      this.setModal (true);
53      this.setResizable (false);
54      this.setContentPane (getJContentPane ());
55    }
56  
57    /**
58     * This method initializes jContentPane
59     * 
60     * @return javax.swing.JPanel
61     */
62    private JPanel getJContentPane ()
63    {
64      if (jContentPane == null)
65      {
66        jContentPane = new JPanel ();
67        jContentPane.setLayout (new BorderLayout ());
68        jContentPane.add (getJPanel (), BorderLayout.NORTH);
69      }
70      return jContentPane;
71    }
72  
73    /**
74     * This method initializes jPanel
75     * 
76     * @return javax.swing.JPanel
77     */
78    private JPanel getJPanel ()
79    {
80      if (jPanel == null)
81      {
82        jPanel = new JPanel ();
83        jPanel.setLayout (new BorderLayout ());
84        jPanel.setBorder (BorderFactory.createTitledBorder (null, "URL zu einer Textdatei:",
85            TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font ("Dialog",
86                Font.BOLD, 12), new Color (51, 51, 51)));
87        jPanel.add (getJTextField (), BorderLayout.CENTER);
88        jPanel.add (getJButton (), BorderLayout.EAST);
89      }
90      return jPanel;
91    }
92  
93    /**
94     * This method initializes jTextField
95     * 
96     * @return javax.swing.JTextField
97     */
98    private JTextField getJTextField ()
99    {
100     if (jTextField == null)
101     {
102       jTextField = new JTextField ();
103       jTextField.setBorder (BorderFactory.createEtchedBorder (EtchedBorder.LOWERED));
104     }
105     return jTextField;
106   }
107 
108   /**
109    * This method initializes jButton
110    * 
111    * @return javax.swing.JButton
112    */
113   private JButton getJButton ()
114   {
115     if (jButton == null)
116     {
117       jButton = new JButton ();
118       jButton.setText ("Durchsuchen...");
119     }
120     return jButton;
121   }
122 
123   public void actionPerformed (ActionEvent event)
124   {
125   }
126 
127 } // @jve:decl-index=0:visual-constraint="137,266"