/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* ConsultaEdificio.java
*
* Created on 23/06/2010, 07:19:35
*/
package calendar.vista;
import calendar.dao.Dao;
import calendar.domino.Edificios;
import java.util.HashMap;
import java.util.Map;
/**
*
* @author gaby
*/
public class ConsultaEdificio extends javax.swing.JDialog {
/** Creates new form ConsultaEdificio */
public ConsultaEdificio(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.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jButtonAlta = new javax.swing.JButton();
jButtonEliminar = new javax.swing.JButton();
jButtonModificar = new javax.swing.JButton();
jTextFieldEdificio = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
jTableEdificio = new javax.swing.JTable();
jLabel1 = new javax.swing.JLabel();
jButtonCancelar = new javax.swing.JButton();
jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(calendar.vista.CalendarApp.class).getContext().getResourceMap(ConsultaEdificio.class);
setTitle(resourceMap.getString("Form.title")); // NOI18N
setName("Form"); // NOI18N
jButtonAlta.setText(resourceMap.getString("jButtonAlta.text")); // NOI18N
jButtonAlta.setName("jButtonAlta"); // NOI18N
jButtonEliminar.setText(resourceMap.getString("jButtonEliminar.text")); // NOI18N
jButtonEliminar.setName("jButtonEliminar"); // NOI18N
jButtonEliminar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonEliminarActionPerformed(evt);
}
});
jButtonModificar.setText(resourceMap.getString("jButtonModificar.text")); // NOI18N
jButtonModificar.setName("jButtonModificar"); // NOI18N
jTextFieldEdificio.setName("jTextFieldEdificio"); // NOI18N
jTextFieldEdificio.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextFieldEdificioActionPerformed(evt);
}
});
jScrollPane1.setName("jScrollPane1"); // NOI18N
jTableEdificio.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jTableEdificio.setName("jTableEdificio"); // NOI18N
jScrollPane1.setViewportView(jTableEdificio);
jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
jLabel1.setName("jLabel1"); // NOI18N
jButtonCancelar.setText(resourceMap.getString("jButtonCancelar.text")); // NOI18N
jButtonCancelar.setName("jButtonCancelar"); // NOI18N
jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jPanel1.setName("jPanel1"); // NOI18N
jLabel2.setForeground(resourceMap.getColor("jLabel2.foreground")); // NOI18N
jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
jLabel2.setName("jLabel2"); // NOI18N
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(37, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
.addComponent(jTextFieldEdificio, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE))
.addContainerGap(38, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(91, Short.MAX_VALUE)
.addComponent(jButtonModificar)
.addGap(18, 18, 18)
.addComponent(jButtonAlta, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButtonEliminar, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButtonCancelar)
.addGap(80, 80, 80))
.addGroup(layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(38, 38, 38)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel1)
.addComponent(jTextFieldEdificio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButtonModificar)
.addComponent(jButtonAlta)
.addComponent(jButtonEliminar)
.addComponent(jButtonCancelar))
.addGap(32, 32, 32))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jTextFieldEdificioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldEdificioActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextFieldEdificioActionPerformed
private void jButtonEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEliminarActionPerformed
Edificios edificio= new Edificios();
Dao daoEdificio = new Dao(edificio);
Map parametros = new HashMap();
parametros.put("nombre", "gorriti");
edificio= (Edificios) daoEdificio.getOne(parametros);
daoEdificio.delete(edificio);
}//GEN-LAST:event_jButtonEliminarActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
ConsultaEdificio dialog = new ConsultaEdificio(new javax.swing.JFrame(), true);
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
}
});
dialog.setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButtonAlta;
private javax.swing.JButton jButtonCancelar;
private javax.swing.JButton jButtonEliminar;
private javax.swing.JButton jButtonModificar;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTableEdificio;
private javax.swing.JTextField jTextFieldEdificio;
// End of variables declaration//GEN-END:variables
}