import javax.swing.JOptionPane;
/*
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor. */
/** *
-
@author Mairton RL */ public class Estoque extends javax.swing.JFrame {
/**
- Creates new form Estoque */ public Estoque() { initComponents();
jTable1.setValueAt("05457", 0, 0); jTable1.setValueAt("05455", 1,0 ); jTable1.setValueAt("09996", 2,0 ); jTable1.setValueAt("088CC", 3,0 ); jTable1.setValueAt("05457", 4,0); jTable1.setValueAt("05677", 5,0 ); jTable1.setValueAt("09654", 6,0 ); jTable1.setValueAt("66978", 7,0 ); // quantidade jTable1.setValueAt("10", 0,4 ); jTable1.setValueAt("8", 1,4 ); jTable1.setValueAt("20", 2,4 ); jTable1.setValueAt("30", 3,4); jTable1.setValueAt("10", 4,4 ); jTable1.setValueAt("20", 5,4 ); jTable1.setValueAt("30", 6,4 ); jTable1.setValueAt("8", 7,4 );
// para remedios jTable1.setValueAt("Canabidiol", 0,1 ); jTable1.setValueAt("250 mgx25", 0,2 ); jTable1.setValueAt("Comprimido", 0,3 );
jTable1.setValueAt("Rimuflan", 1,1 ); jTable1.setValueAt("500mgx50", 1,2 ); jTable1.setValueAt("Capsulas", 1,3 ); jTable1.setValueAt("Paracetamol", 2,1 ); jTable1.setValueAt("250mgx50", 2,2 ); jTable1.setValueAt("Comprimido", 2,3 ); jTable1.setValueAt("Dorflex", 3,1 ); jTable1.setValueAt("250mgx50", 3,2 ); jTable1.setValueAt("Comprimido", 3,3 ); jTable1.setValueAt("Suflax", 4,1 ); jTable1.setValueAt("500mgx25", 4,2 ); jTable1.setValueAt("Capsula", 4,3 ); jTable1.setValueAt("Fluviral", 5,1 ); jTable1.setValueAt("250mgx50", 5,2 ); jTable1.setValueAt("Comprimido", 5,3 ); jTable1.setValueAt("Nimesulida", 6,1 ); jTable1.setValueAt("250mgx50", 6,2 ); jTable1.setValueAt("Comprimido", 6,3 ); jTable1.setValueAt("Vitamina C", 7,1 ); jTable1.setValueAt("250mgx50", 7,2 ); jTable1.setValueAt("Comprimido", 7,3 ); }
/**
-
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") //
private void initComponents() {jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jLabel2 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jLabel3 = new javax.swing.JLabel(); jButton3 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Sistema Farmabem"); setForeground(java.awt.Color.red);
jTable1.setBackground(new java.awt.Color(51, 51, 51)); jTable1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2)); jTable1.setForeground(new java.awt.Color(255, 255, 255)); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null}, {null, null, null, null, null} }, new String [] { "Medicamentos", "Nome Comercial", "Apresentação", "Forma Farmaceutica", "Qtd Disponivel" } )); jScrollPane1.setViewportView(jTable1);
jLabel2.setFont(new java.awt.Font("Times New Roman", 3, 24)); // NOI18N jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel2.setText("Controle de Estoque");
jLabel1.setFont(new java.awt.Font("Times New Roman", 3, 24)); // NOI18N jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("Fabricante: Gemaque Laboratórios Brasil S/A");
jButton1.setText("Solicitar"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } });
jButton2.setText("Retornar"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } });
jLabel3.setText("Estoque baixo ? Clique aqui para solicitar mais>> ");
jButton3.setText("Solicitar novos Medicamentos"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } });
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(19, 19, 19) .addComponent(jScrollPane1) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 478, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(62, 62, 62)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(167, 167, 167) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(30, 30, 30) .addComponent(jButton3) .addGap(52, 52, 52) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 283, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(44, 44, 44) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(39, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(39, 39, 39) .addComponent(jLabel1) .addGap(33, 33, 33) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 55, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton3) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton1)) .addGap(36, 36, 36) .addComponent(jButton2) .addGap(29, 29, 29)) );
pack(); }//
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
JOptionPane.showConfirmDialog(null, "Solicitar mais medicamentos? ","Aumento de Estoque",JOptionPane.YES_NO_OPTION); if (JOptionPane.YES_NO_OPTION == JOptionPane.YES_OPTION){ String nomeC = JOptionPane.showInputDialog(null,"Nome Comercial do Medicamento:","Dados de Estoque baixo Medicamento",JOptionPane.WARNING_MESSAGE); int qtd = Integer.parseInt(JOptionPane.showInputDialog(null," Informe a Quantidade de Medicamentos:","Dados de Estoque baixo Medicamento",JOptionPane.WARNING_MESSAGE)); JOptionPane.showConfirmDialog(null, "Dados do Medicamento Solicitado: "+"\n"+nomeC+"\n"+qtd,"Confirmar pedido de aumento de medicamento ?",JOptionPane.YES_NO_OPTION); if(JOptionPane.YES_NO_OPTION == JOptionPane.YES_OPTION){ JOptionPane.showMessageDialog(null,"Pedido ao Fabricante Enviado com Sucesso !"); }else if (JOptionPane.YES_NO_OPTION == JOptionPane.NO_OPTION){ JOptionPane.showMessageDialog(null, "Solicitação Cancelada ao Fabricante"); } }}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
setVisible(false); new Teladestino().setVisible(true); }private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
JOptionPane.showConfirmDialog(null, "Solicitar novo medicamento? ","Novo Medicamento",JOptionPane.YES_NO_OPTION); if(JOptionPane.YES_NO_OPTION == JOptionPane.YES_OPTION){ String nome = JOptionPane.showInputDialog(null,"Codigo do Medicamento:","Dados do Novo Medicamento",JOptionPane.WARNING_MESSAGE); String nomeC = JOptionPane.showInputDialog(null,"Nome Comercial do Medicamento:","Dados do Novo Medicamento",JOptionPane.WARNING_MESSAGE); String ap = JOptionPane.showInputDialog(null,"Apresentação do Medicamento:","Dados do Novo Medicamento",JOptionPane.WARNING_MESSAGE);
String form = JOptionPane.showInputDialog(null,"Forma Farmaceutica do Medicamento:","Dados do Novo Medicamento",JOptionPane.WARNING_MESSAGE);
int qtd = Integer.parseInt(JOptionPane.showInputDialog(null,"Quantidade de Medicamentos:","Dados do Novo Medicamento",JOptionPane.WARNING_MESSAGE)); JOptionPane.showConfirmDialog(null, "Dados do Novo Medicamento Solicitado: \n"+nome+"\n"+nomeC+"\n"+ap+"\n"+form+"\n"+qtd,"Confirmar novo medicamento ?",JOptionPane.YES_NO_OPTION); if(JOptionPane.YES_NO_OPTION == JOptionPane.YES_OPTION){ JOptionPane.showMessageDialog(null,"Pedido ao Fabricante Enviado com Sucesso !"); }else if(JOptionPane.YES_NO_OPTION == JOptionPane.NO_OPTION) { JOptionPane.showMessageDialog(null, "Solicitação Cancelada ao Fabricante"); } } }/**
-
@param args the command line arguments / public static void main(String args[]) { / Set the Nimbus look and feel / // / 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(Estoque.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Estoque.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Estoque.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Estoque.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //
/* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Estoque().setVisible(true); } }); }
// Variables declaration - do not modify
private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTable jTable1; // End of variables declaration
}