1 /* 2 Copyright (c) 2003, Laurent Caillette. 3 All rights reserved. 4 5 Redistribution and use in source and binary forms, with or without modifica- 6 tion, are permitted provided that the following conditions are met: 7 8 1. Redistributions of source code must retain the above copyright notice, 9 this list of conditions and the following disclaimer. 10 11 2. Redistributions in binary form must reproduce the above copyright notice, 12 this list of conditions and the following disclaimer in the documentation 13 and/or other materials provided with the distribution. 14 15 3. The end-user documentation included with the redistribution, if any, must 16 include the following acknowledgment: "This product includes software 17 written by Laurent Caillette." 18 Alternately, this acknowledgment may appear in the software itself, if 19 and wherever such third-party acknowledgments normally appear. 20 21 4. The name "Laurent Caillette" must not be used to endorse or 22 promote products derived from this software without 23 prior written permission. For written permission, please contact 24 laurent.caillette@laposte.net 25 26 5. Products derived from this software may not be called 27 "Laurent Caillette", nor may "Laurent Caillette" appear 28 in their name, without prior written permission of the 29 author. 30 31 THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, 32 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 33 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 34 AUTHOR (LAURENT CAILLETTE) BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 35 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 36 TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 37 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 38 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 39 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 40 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 */ 42 package tweed.demo; 43 import javax.swing.JLabel; 44 import javax.swing.JPanel; 45 import javax.swing.JTextField; 46 import javax.swing.SwingConstants; 47 import javax.swing.border.Border; 48 import javax.swing.border.EtchedBorder; 49 import javax.swing.border.TitledBorder; 50 import java.awt.Color; 51 import java.awt.GridBagConstraints; 52 import java.awt.GridBagLayout; 53 import java.awt.Insets; 54 55 public class CustomerPanel extends JPanel { 56 private final GridBagLayout gridBagLayout1 = new GridBagLayout(); 57 private JLabel jLabelId = new JLabel(); 58 /*package*/ JTextField jTextFieldId = new JTextField()/package-summary.html">color="#329900">package*/ JTextField jTextFieldId = new JTextField(); 59 private JLabel jLabelCustomerName = new JLabel(); 60 /*package*/ final JTextField jTextFieldName = new JTextField()/package-summary.html">color="#329900">package*/ final JTextField jTextFieldName = new JTextField(); 61 /*package*/ final AddressPanel addressPanel = new AddressPanel()/package-summary.html">color="#329900">package*/ final AddressPanel addressPanel = new AddressPanel(); 62 private Border border1; 63 private TitledBorder titledBorder1; 64 65 public CustomerPanel() { 66 jbInit(); 67 } 68 private void jbInit() { 69 border1 = new EtchedBorder(EtchedBorder.RAISED,Color.white,new Color(134, 134, 134)); 70 titledBorder1 = new TitledBorder(border1,"Customer"); 71 jLabelId.setText("Customer ID"); 72 this.setLayout(gridBagLayout1); 73 jTextFieldId.setColumns(5); 74 jTextFieldId.setHorizontalAlignment(SwingConstants.RIGHT); 75 jLabelCustomerName.setText("Name"); 76 this.setBorder(titledBorder1); 77 addressPanel.setAlignmentX((float) 0.0); 78 this.add(jLabelId, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 79 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); 80 this.add(jTextFieldId, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 81 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); 82 this.add(jLabelCustomerName, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 83 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); 84 this.add(jTextFieldName, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 85 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 100, 0)); 86 this.add( addressPanel, new GridBagConstraints(0, 2, 2, 1, 0.0, 0.0 87 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); 88 } 89 90 } 91

This page was automatically generated by Maven