/*
* TemplateForm.java
*
* Created on 2 de junio de 2008, 04:53 PM
*/
package gafetes;
/**
*
* @author jalafita
*/
public class TemplateForm extends javax.swing.JFrame {
/** Creates new form TemplateForm */
public TemplateForm(java.awt.Frame parent, boolean modal) {
// super(parent, modal);
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
jButton2 = new javax.swing.JButton();
jPanel1 = new javax.swing.JPanel();
saveButton = new javax.swing.JButton();
cancelButton = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
jPanel3 = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
jPanel5 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
idTextField = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
nombreTextField = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
rutaTextField = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
direccionTextField = new javax.swing.JTextArea();
jLabel6 = new javax.swing.JLabel();
rutaReversoTextField = new javax.swing.JTextField();
jLabel7 = new javax.swing.JLabel();
jButton2.setText("jButton2");
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
saveButton.setText("Guardar");
jPanel1.add(saveButton);
cancelButton.setText("Cancelar");
jPanel1.add(cancelButton);
getContentPane().add(jPanel1, java.awt.BorderLayout.NORTH);
getContentPane().add(jPanel2, java.awt.BorderLayout.EAST);
getContentPane().add(jPanel3, java.awt.BorderLayout.SOUTH);
getContentPane().add(jPanel4, java.awt.BorderLayout.WEST);
jPanel5.setLayout(null);
jPanel5.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
jPanel5.setPreferredSize(new java.awt.Dimension(500, 350));
jLabel1.setText("ID");
jPanel5.add(jLabel1);
jLabel1.setBounds(20, 40, 70, 20);
jPanel5.add(idTextField);
idTextField.setBounds(90, 40, 140, 20);
jLabel2.setText("NOMBRE");
jPanel5.add(jLabel2);
jLabel2.setBounds(20, 70, 70, 20);
jPanel5.add(nombreTextField);
nombreTextField.setBounds(90, 70, 390, 20);
jPanel5.add(jLabel3);
jLabel3.setBounds(0, 0, 0, 0);
jLabel4.setText("RUTA");
jPanel5.add(jLabel4);
jLabel4.setBounds(20, 100, 70, 20);
jPanel5.add(rutaTextField);
rutaTextField.setBounds(90, 100, 390, 20);
jLabel5.setText("DIRECCION");
jPanel5.add(jLabel5);
jLabel5.setBounds(20, 130, 70, 20);
direccionTextField.setColumns(20);
direccionTextField.setRows(5);
jScrollPane1.setViewportView(direccionTextField);
jPanel5.add(jScrollPane1);
jScrollPane1.setBounds(90, 130, 390, 100);
jLabel6.setText("RUTA REVERSO");
jPanel5.add(jLabel6);
jLabel6.setBounds(20, 240, 90, 14);
jPanel5.add(rutaReversoTextField);
rutaReversoTextField.setBounds(20, 260, 460, 20);
jLabel7.setFont(new java.awt.Font("Tahoma", 1, 18));
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel7.setText("Configuraci\u00f3n de Plantilla");
jPanel5.add(jLabel7);
jLabel7.setBounds(150, 10, 330, 22);
getContentPane().add(jPanel5, java.awt.BorderLayout.CENTER);
pack();
}// </editor-fold>//GEN-END:initComponents
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new TemplateForm(new javax.swing.JFrame(), true).setVisible(true);
}
});
}
public void setEditMode(gafetes.beans.Template em){
/*
gafetes.beans.Empleado em;
em = gafetes.business.SqlHelper.getEmpleadoById(e);
em.setId(e.getId());*/
idTextField.setText("" + em.getId() );
nombreTextField.setText(em.getNombre());
rutaReversoTextField.setText(em.getRutaReverso());
rutaTextField.setText(em.getRuta());
direccionTextField.setText(em.getDireccion());
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton cancelButton;
private javax.swing.JTextArea direccionTextField;
private javax.swing.JTextField idTextField;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextField nombreTextField;
private javax.swing.JTextField rutaReversoTextField;
private javax.swing.JTextField rutaTextField;
private javax.swing.JButton saveButton;
// End of variables declaration//GEN-END:variables
}