/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package controleEstoque.formularios;
import controleEstoque.tabelas.Tabela;
import javax.swing.table.DefaultTableModel;
/**
*
* @author Christopher
*/
public class FrmListaSaidaProdutos extends javax.swing.JFrame {
/**
* Creates new form FrmListaSaidaProdutos
*/
public FrmListaSaidaProdutos() {
initComponents();
this.setResizable(false);
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
}
/**
* 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() {
jLabel1 = new javax.swing.JLabel();
txtData = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
txtFuncionario = new javax.swing.JTextField();
btnRetirarProdutos = new javax.swing.JButton();
btnCancelar = new javax.swing.JButton();
jScrollPane2 = new javax.swing.JScrollPane();
tabProdutos = new javax.swing.JTable();
setMaximumSize(new java.awt.Dimension(449, 387));
setMinimumSize(new java.awt.Dimension(449, 387));
setPreferredSize(new java.awt.Dimension(449, 387));
getContentPane().setLayout(null);
jLabel1.setText("Funcionário");
getContentPane().add(jLabel1);
jLabel1.setBounds(70, 100, 100, 14);
txtData.setEnabled(false);
txtData.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtDataActionPerformed(evt);
}
});
getContentPane().add(txtData);
txtData.setBounds(180, 70, 130, 20);
jLabel2.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N
jLabel2.setText("Retirada de produtos");
getContentPane().add(jLabel2);
jLabel2.setBounds(130, 10, 190, 30);
jLabel3.setText("Data de retirada");
getContentPane().add(jLabel3);
jLabel3.setBounds(70, 70, 100, 14);
txtFuncionario.setEnabled(false);
txtFuncionario.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtFuncionarioActionPerformed(evt);
}
});
getContentPane().add(txtFuncionario);
txtFuncionario.setBounds(180, 100, 130, 20);
btnRetirarProdutos.setText("Retirar produtos");
getContentPane().add(btnRetirarProdutos);
btnRetirarProdutos.setBounds(240, 300, 140, 23);
btnCancelar.setText("Cancelar");
btnCancelar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancelarActionPerformed(evt);
}
});
getContentPane().add(btnCancelar);
btnCancelar.setBounds(70, 300, 120, 23);
atualizaTabela();
tabProdutos.getTableHeader().setReorderingAllowed(false);
jScrollPane2.setViewportView(tabProdutos);
tabProdutos.getColumnModel().getColumn(0).setResizable(false);
tabProdutos.getColumnModel().getColumn(0).setPreferredWidth(280);
tabProdutos.getColumnModel().getColumn(1).setResizable(false);
tabProdutos.getColumnModel().getColumn(2).setResizable(false);
tabProdutos.getColumnModel().getColumn(3).setResizable(false);
getContentPane().add(jScrollPane2);
jScrollPane2.setBounds(20, 140, 400, 150);
pack();
}// </editor-fold>//GEN-END:initComponents
private void txtDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtDataActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtDataActionPerformed
private void txtFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtFuncionarioActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtFuncionarioActionPerformed
private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed
this.dispose();
}//GEN-LAST:event_btnCancelarActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/*
* Set the Nimbus look and feel
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and feel. For details see
* http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(FrmListaSaidaProdutos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FrmListaSaidaProdutos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FrmListaSaidaProdutos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FrmListaSaidaProdutos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/*
* Create and display the form
*/
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FrmListaSaidaProdutos().setVisible(true);
}
});
}
private void atualizaTabela() {
Tabela tp = new Tabela(3, new String[] {"Produto", "Qtd at.", "Qtd ret.", "Valor unit."}, 4);
DefaultTableModel modelo = new DefaultTableModel(tp.getCelulas(), tp.getNomeColunas());
tabProdutos.setModel(modelo);
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCancelar;
private javax.swing.JButton btnRetirarProdutos;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTable tabProdutos;
private javax.swing.JTextField txtData;
private javax.swing.JTextField txtFuncionario;
// End of variables declaration//GEN-END:variables
}