Java tutorial
package com.spirit.medios.gui.panel; import javax.swing.*; import com.jgoodies.forms.factories.*; import com.jgoodies.forms.layout.*; /* * Created by JFormDesigner on Tue Oct 28 16:13:22 COT 2014 */ import com.spirit.client.model.MantenimientoModelImpl; /** * @author xruiz */ public abstract class JPOrdenMedio extends MantenimientoModelImpl { public JPOrdenMedio() { initComponents(); setName("Orden de Medios"); } private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Open Source Project license - unknown lblCodigo = new JLabel(); txtCodigo = new JTextField(); btnConsultar = new JButton(); lblMedioOficina = new JLabel(); txtMedioOficina = new JTextField(); lblFecha = new JLabel(); txtFecha = new JTextField(); lblEstado = new JLabel(); txtEstado = new JTextField(); CellConstraints cc = new CellConstraints(); //======== this ======== setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(100)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(100)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(10)) }, new RowSpec[] { new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)) })); //---- lblCodigo ---- lblCodigo.setText("C\u00f3digo:"); add(lblCodigo, cc.xywh(3, 3, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); //---- txtCodigo ---- txtCodigo.setHorizontalAlignment(SwingConstants.RIGHT); add(txtCodigo, cc.xy(5, 3)); //---- btnConsultar ---- btnConsultar.setText("Consultar"); add(btnConsultar, cc.xy(9, 3)); //---- lblMedioOficina ---- lblMedioOficina.setText("Medio Oficina:"); add(lblMedioOficina, cc.xy(3, 5)); //---- txtMedioOficina ---- txtMedioOficina.setEditable(false); add(txtMedioOficina, cc.xywh(5, 5, 7, 1)); //---- lblFecha ---- lblFecha.setText("Fecha:"); add(lblFecha, cc.xywh(3, 7, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); //---- txtFecha ---- txtFecha.setEditable(false); add(txtFecha, cc.xy(5, 7)); //---- lblEstado ---- lblEstado.setText("Estado:"); add(lblEstado, cc.xywh(3, 9, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); //---- txtEstado ---- txtEstado.setEditable(false); add(txtEstado, cc.xy(5, 9)); // JFormDesigner - End of component initialization //GEN-END:initComponents } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables // Generated using JFormDesigner Open Source Project license - unknown private JLabel lblCodigo; private JTextField txtCodigo; private JButton btnConsultar; private JLabel lblMedioOficina; private JTextField txtMedioOficina; private JLabel lblFecha; private JTextField txtFecha; private JLabel lblEstado; private JTextField txtEstado; // JFormDesigner - End of variables declaration //GEN-END:variables public JTextField getTxtCodigo() { return txtCodigo; } public void setTxtCodigo(JTextField txtCodigo) { this.txtCodigo = txtCodigo; } public JButton getBtnConsultar() { return btnConsultar; } public void setBtnConsultar(JButton btnConsultar) { this.btnConsultar = btnConsultar; } public JTextField getTxtMedioOficina() { return txtMedioOficina; } public void setTxtMedioOficina(JTextField txtMedioOficina) { this.txtMedioOficina = txtMedioOficina; } public JTextField getTxtFecha() { return txtFecha; } public void setTxtFecha(JTextField txtFecha) { this.txtFecha = txtFecha; } public JTextField getTxtEstado() { return txtEstado; } public void setTxtEstado(JTextField txtEstado) { this.txtEstado = txtEstado; } }