Java tutorial
/* * Copyright (c) 2007 Agile-Works * All rights reserved. * * This software is the confidential and proprietary information of * Agile-Works. ("Confidential Information"). * You shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement you * entered into with Agile-Works. */ package com.aw.swing.mvp.cmp.pick; import com.aw.swing.mvp.ui.GradientPanel; import com.aw.swing.mvp.ui.Separator; import com.jgoodies.forms.layout.CellConstraints; import com.jgoodies.forms.layout.FormLayout; import javax.swing.*; import java.awt.*; /** * User: Julio Gonzales * Date: 14-nov-2007 */ public class FrmPickMovAlm extends FrmPick { protected boolean addSupport = false; protected boolean editSupport = false; private boolean addCRUDAcciones = false; public JPanel pnlMain; public JTextField txtSearch; public JButton btnSearch; public JLabel lblSearch; public JPanel footerPanel; public Separator sepCriterioBusqueda; public JPanel pnlTitGrid; public JTable tblGrid; public JLabel lblTitGrid; public JLabel lblNumRegistros; public JLabel lblF10; public JLabel lblEsc; public JCheckBox chkSel; public JLabel lblSearch2; public JComboBox cmbAlmacen; public JLabel lblFecIni; public JLabel lblFecFin; public JTextField txtFecIni; public JTextField txtFecFin; public String title = " "; public String description = " "; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } private void createUIComponents() { footerPanel = new GradientPanel(); pnlTitGrid = new GradientPanel(); sepCriterioBusqueda = new Separator("Criterio de Bsqueda"); } public boolean isAddSupport() { return addSupport; } public void setAddSupport(boolean addSupport) { this.addSupport = addSupport; } public boolean isEditSupport() { return editSupport; } public void setEditSupport(boolean editSupport) { this.editSupport = editSupport; } public boolean isAddCRUDAcciones() { return addCRUDAcciones; } public void setAddCRUDAcciones(boolean addCRUDAcciones) { this.addCRUDAcciones = addCRUDAcciones; } public JPanel getPnlMain() { return pnlMain; } public void setPnlMain(JPanel pnlMain) { this.pnlMain = pnlMain; } public JTextField getTxtSearch() { return txtSearch; } public void setTxtSearch(JTextField txtSearch) { this.txtSearch = txtSearch; } public JButton getBtnSearch() { return btnSearch; } public void setBtnSearch(JButton btnSearch) { this.btnSearch = btnSearch; } public JLabel getLblSearch() { return lblSearch; } public void setLblSearch(JLabel lblSearch) { this.lblSearch = lblSearch; } public JPanel getFooterPanel() { return footerPanel; } public void setFooterPanel(JPanel footerPanel) { this.footerPanel = footerPanel; } public Separator getSepCriterioBusqueda() { return sepCriterioBusqueda; } public void setSepCriterioBusqueda(Separator sepCriterioBusqueda) { this.sepCriterioBusqueda = sepCriterioBusqueda; } public JPanel getPnlTitGrid() { return pnlTitGrid; } public void setPnlTitGrid(JPanel pnlTitGrid) { this.pnlTitGrid = pnlTitGrid; } public JTable getTblGrid() { return tblGrid; } public void setTblGrid(JTable tblGrid) { this.tblGrid = tblGrid; } public JLabel getLblTitGrid() { return lblTitGrid; } public void setLblTitGrid(JLabel lblTitGrid) { this.lblTitGrid = lblTitGrid; } public JLabel getLblNumRegistros() { return lblNumRegistros; } public void setLblNumRegistros(JLabel lblNumRegistros) { this.lblNumRegistros = lblNumRegistros; } public JLabel getLblF10() { return lblF10; } public void setLblF10(JLabel lblF10) { this.lblF10 = lblF10; } public JLabel getLblEsc() { return lblEsc; } public void setLblEsc(JLabel lblEsc) { this.lblEsc = lblEsc; } public JCheckBox getChkSel() { return chkSel; } public void setChkSel(JCheckBox chkSel) { this.chkSel = chkSel; } { // GUI initializer generated by IntelliJ IDEA GUI Designer // >>> IMPORTANT!! <<< // DO NOT EDIT OR ADD ANY CODE HERE! $$$setupUI$$$(); } /** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL */ private void $$$setupUI$$$() { createUIComponents(); pnlMain = new JPanel(); pnlMain.setLayout(new FormLayout( "left:25dlu:noGrow,fill:52dlu:noGrow,left:8dlu:noGrow,fill:43dlu:noGrow,left:10dlu:noGrow,fill:13px:noGrow,left:19dlu:noGrow,fill:8px:noGrow,left:56dlu:noGrow,fill:10px:noGrow,fill:50dlu:noGrow,left:22dlu:noGrow", "center:12dlu:noGrow,top:4dlu:noGrow,center:12dlu:noGrow,top:5dlu:noGrow,center:12dlu:noGrow,top:3dlu:noGrow,center:18px:noGrow,top:4dlu:noGrow,top:12dlu:noGrow,center:149dlu:noGrow,top:4dlu:noGrow,top:12dlu:noGrow,center:max(d;4dlu):noGrow,center:12dlu:noGrow")); pnlMain.setMinimumSize(new Dimension(501, 425)); pnlMain.setOpaque(true); pnlMain.setPreferredSize(new Dimension(501, 425)); lblSearch = new JLabel(); lblSearch.setText("Descripcin"); lblSearch.setDisplayedMnemonic('D'); lblSearch.setDisplayedMnemonicIndex(0); CellConstraints cc = new CellConstraints(); pnlMain.add(lblSearch, cc.xyw(1, 3, 2, CellConstraints.RIGHT, CellConstraints.DEFAULT)); btnSearch = new JButton(); btnSearch.setText("Buscar"); btnSearch.setMnemonic('B'); btnSearch.setDisplayedMnemonicIndex(0); pnlMain.add(btnSearch, cc.xy(11, 3)); footerPanel.setLayout( new FormLayout("fill:73dlu:noGrow,left:191dlu:noGrow,fill:48dlu:noGrow", "center:12dlu:noGrow")); pnlMain.add(footerPanel, cc.xyw(1, 14, 12, CellConstraints.DEFAULT, CellConstraints.FILL)); lblF10 = new JLabel(); lblF10.setText(" [F10] Aceptar"); footerPanel.add(lblF10, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); lblEsc = new JLabel(); lblEsc.setText(" [Esc] Salir"); footerPanel.add(lblEsc, cc.xy(3, 1)); sepCriterioBusqueda.setSeparatorTitle("Criterio de Bsqueda"); pnlMain.add(sepCriterioBusqueda, cc.xyw(1, 1, 12, CellConstraints.FILL, CellConstraints.FILL)); pnlTitGrid.setLayout( new FormLayout("fill:204dlu:noGrow,left:88dlu:noGrow,fill:15dlu:noGrow", "center:12dlu:noGrow")); pnlMain.add(pnlTitGrid, cc.xyw(1, 9, 12, CellConstraints.FILL, CellConstraints.FILL)); lblTitGrid = new JLabel(); lblTitGrid.setText(" Relacin :"); lblTitGrid.setDisplayedMnemonic('R'); lblTitGrid.setDisplayedMnemonicIndex(1); pnlTitGrid.add(lblTitGrid, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); chkSel = new JCheckBox(); chkSel.setBackground(new Color(-16747105)); chkSel.setText(""); pnlTitGrid.add(chkSel, cc.xy(3, 1)); final JScrollPane scrollPane1 = new JScrollPane(); scrollPane1.setMinimumSize(new Dimension(454, 418)); pnlMain.add(scrollPane1, cc.xyw(1, 10, 12, CellConstraints.FILL, CellConstraints.FILL)); tblGrid = new JTable(); tblGrid.setMinimumSize(new Dimension(450, 400)); scrollPane1.setViewportView(tblGrid); final JLabel label1 = new JLabel(); label1.setText(" Nmero de Registros:"); pnlMain.add(label1, cc.xyw(1, 12, 3)); lblNumRegistros = new JLabel(); lblNumRegistros.setText("Label"); pnlMain.add(lblNumRegistros, cc.xyw(4, 12, 7)); txtSearch = new JTextField(); pnlMain.add(txtSearch, cc.xyw(4, 3, 6, CellConstraints.FILL, CellConstraints.DEFAULT)); lblSearch2 = new JLabel(); lblSearch2.setText("Descripcin2"); lblSearch2.setDisplayedMnemonic('D'); lblSearch2.setDisplayedMnemonicIndex(0); pnlMain.add(lblSearch2, cc.xyw(1, 7, 2, CellConstraints.RIGHT, CellConstraints.DEFAULT)); cmbAlmacen = new JComboBox(); pnlMain.add(cmbAlmacen, cc.xyw(4, 7, 6)); lblFecIni = new JLabel(); lblFecIni.setText("Fecha del"); pnlMain.add(lblFecIni, cc.xyw(1, 5, 2, CellConstraints.RIGHT, CellConstraints.CENTER)); txtFecIni = new JTextField(); pnlMain.add(txtFecIni, cc.xyw(4, 5, 3, CellConstraints.FILL, CellConstraints.DEFAULT)); lblFecFin = new JLabel(); lblFecFin.setText("al"); pnlMain.add(lblFecFin, cc.xy(7, 5, CellConstraints.RIGHT, CellConstraints.CENTER)); txtFecFin = new JTextField(); pnlMain.add(txtFecFin, cc.xy(9, 5, CellConstraints.FILL, CellConstraints.DEFAULT)); lblSearch.setLabelFor(txtSearch); lblSearch2.setLabelFor(txtSearch); lblFecIni.setLabelFor(txtSearch); lblFecFin.setLabelFor(txtSearch); } /** * @noinspection ALL */ public JComponent $$$getRootComponent$$$() { return pnlMain; } }