Revision 9256
trunk/extensions/extCatalogYNomenclator/src/es/gva/cit/gvsig/gazetteer/gui/tools/AddSearchToolPanel.java | ||
---|---|---|
1 |
package es.gva.cit.gvsig.gazetteer.gui.tools; |
|
2 |
|
|
3 |
import java.awt.Dimension; |
|
4 |
import java.awt.GridBagConstraints; |
|
5 |
import java.awt.GridBagLayout; |
|
6 |
|
|
7 |
import javax.swing.JButton; |
|
8 |
import javax.swing.JPanel; |
|
9 |
import javax.swing.JTextField; |
|
10 |
|
|
11 |
public class AddSearchToolPanel extends JPanel{ |
|
12 |
|
|
13 |
private JTextField jTextField = null; |
|
14 |
private JButton jButton = null; |
|
15 |
|
|
16 |
/** |
|
17 |
* This is the default constructor |
|
18 |
*/ |
|
19 |
public AddSearchToolPanel() { |
|
20 |
super(); |
|
21 |
initialize(); |
|
22 |
} |
|
23 |
|
|
24 |
/** |
|
25 |
* This method initializes this |
|
26 |
* |
|
27 |
* @return void |
|
28 |
*/ |
|
29 |
private void initialize() { |
|
30 |
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
|
31 |
gridBagConstraints1.gridx = 1; |
|
32 |
gridBagConstraints1.insets = new java.awt.Insets(0,4,0,4); |
|
33 |
gridBagConstraints1.gridy = 0; |
|
34 |
GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
|
35 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
36 |
gridBagConstraints.gridy = 0; |
|
37 |
gridBagConstraints.weightx = 1.0; |
|
38 |
gridBagConstraints.insets = new java.awt.Insets(0,4,0,4); |
|
39 |
gridBagConstraints.gridx = 0; |
|
40 |
this.setLayout(new GridBagLayout()); |
|
41 |
this.setSize(250, 50); |
|
42 |
this.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1)); |
|
43 |
this.add(getJTextField(), gridBagConstraints); |
|
44 |
this.add(getJButton(), gridBagConstraints1); |
|
45 |
} |
|
46 |
|
|
47 |
/** |
|
48 |
* This method initializes jTextField |
|
49 |
* |
|
50 |
* @return javax.swing.JTextField |
|
51 |
*/ |
|
52 |
private JTextField getJTextField() { |
|
53 |
if (jTextField == null) { |
|
54 |
jTextField = new JTextField(); |
|
55 |
jTextField.setPreferredSize(new Dimension(150, 25)); |
|
56 |
} |
|
57 |
return jTextField; |
|
58 |
} |
|
59 |
|
|
60 |
/** |
|
61 |
* This method initializes jButton |
|
62 |
* |
|
63 |
* @return javax.swing.JButton |
|
64 |
*/ |
|
65 |
private JButton getJButton() { |
|
66 |
if (jButton == null) { |
|
67 |
jButton = new JButton(); |
|
68 |
jButton.setText("Buscar"); |
|
69 |
jButton.setPreferredSize(new Dimension(80,25)); |
|
70 |
} |
|
71 |
return jButton; |
|
72 |
} |
|
73 |
|
|
74 |
public void setComponentSize(int w, int h){ |
|
75 |
this.setSize(w, h); |
|
76 |
} |
|
77 |
|
|
78 |
} |
Also available in: Unified diff