regenerated by the Form Editor.
*/
@SuppressWarnings(“unchecked”)
//
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jtfCodigo = new javax.swing.JTextField();
jtfNome = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jtfPesquisar = new javax.swing.JTextField();
jbProcurar = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
jtableProdutos = new javax.swing.JTable();
jbNovo = new javax.swing.JButton();
jbAlterar = new javax.swing.JButton();
jbCancelar = new javax.swing.JButton();
jbExcluir = new javax.swing.JButton();
jbSalvar = new javax.swing.JButton();
jtfEstoque = new javax.swing.JFormattedTextField();
jtfValor = new javax.swing.JFormattedTextField();
jbRelatorio = new javax.swing.JButton();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle(“Produtos”);
jLabel1.setText(“Código:”);
jtfCodigo.setEnabled(false);
jLabel2.setText(“Descrição do Produto:”);
jLabel3.setText(“Estoque:”);
jLabel4.setText(“ValorR$:”);
jLabel5.setText(“Pesquisar”);
jtfPesquisar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jtfPesquisarActionPerformed(evt);
}
});
jbProcurar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/18 x 18/procurar.png"))); // NOI18N
jbProcurar.setText(“Procurar”);
jbProcurar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbProcurarActionPerformed(evt);
}
});
jtableProdutos.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"Codigo", "Descrição do Produto", "Estoque", "Valor R$"
}
) {
boolean[] canEdit = new boolean [] {
true, false, true, true
};
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
jScrollPane1.setViewportView(jtableProdutos);
if (jtableProdutos.getColumnModel().getColumnCount() > 0) {
jtableProdutos.getColumnModel().getColumn(0).setMinWidth(60);
jtableProdutos.getColumnModel().getColumn(0).setPreferredWidth(60);
jtableProdutos.getColumnModel().getColumn(0).setMaxWidth(60);
jtableProdutos.getColumnModel().getColumn(2).setMinWidth(90);
jtableProdutos.getColumnModel().getColumn(2).setPreferredWidth(90);
jtableProdutos.getColumnModel().getColumn(2).setMaxWidth(90);
jtableProdutos.getColumnModel().getColumn(3).setMinWidth(90);
jtableProdutos.getColumnModel().getColumn(3).setPreferredWidth(90);
jtableProdutos.getColumnModel().getColumn(3).setMaxWidth(90);
}
jbNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/18 x 18/novo.png"))); // NOI18N
jbNovo.setText(“Novo”);
jbNovo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbNovoActionPerformed(evt);
}
});
jbAlterar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/18 x 18/editar.png"))); // NOI18N
jbAlterar.setText(“Alterar”);
jbAlterar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbAlterarActionPerformed(evt);
}
});
jbCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/18 x 18/cancelar.png"))); // NOI18N
jbCancelar.setText(“Cancelar”);
jbCancelar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbCancelarActionPerformed(evt);
}
});
jbExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/18 x 18/excluir.png"))); // NOI18N
jbExcluir.setText(“Excluir”);
jbExcluir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbExcluirActionPerformed(evt);
}
});
jbSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/18 x 18/salvar.png"))); // NOI18N
jbSalvar.setText(“Salvar”);
jbSalvar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbSalvarActionPerformed(evt);
}
});
jtfEstoque.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
jtfValor.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#,##0.00"))));
jbRelatorio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/18 x 18/impressao.png"))); // NOI18N
jbRelatorio.setText(“Relatório”);
jbRelatorio.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jbRelatorioActionPerformed(evt);
}
});
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()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jtfCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jtfNome)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jtfPesquisar, javax.swing.GroupLayout.PREFERRED_SIZE, 480, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jbProcurar, javax.swing.GroupLayout.DEFAULT_SIZE, 112, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3)
.addComponent(jtfEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4)
.addComponent(jtfValor, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jbNovo)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jbAlterar)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jbCancelar)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jbExcluir)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jbRelatorio)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jbSalvar)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jtfCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jtfNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jLabel4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jtfEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jtfValor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(jtfPesquisar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jbProcurar))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 329, Short.MAX_VALUE)
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jbNovo)
.addComponent(jbAlterar)
.addComponent(jbCancelar)
.addComponent(jbExcluir)
.addComponent(jbSalvar)
.addComponent(jbRelatorio))
.addContainerGap())
);
jMenu1.setText(“Arquivo”);
jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
jMenuItem1.setText(“Fechar”);
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem1);
jMenuBar1.add(jMenu1);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
);
pack();
}//