Академический Документы
Профессиональный Документы
Культура Документы
import java.sql.Connection;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JInternalFrame;
import javax.swing.JOptionPane;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.util.JRLoader;
import net.sf.jasperreports.view.JRViewer;
/**
*
* @author pcserver
*/
public class Menu extends javax.swing.JFrame {
Connection conn;
Conexion cn= new Conexion();
/**
* Creates new form Menu
*/
public Menu() {
initComponents();
/* escritorio.setBorder(new ImagenFondo());
this.setExtendedState(Menu.MAXIMIZED_BOTH);
conn= cn.getConnection();*/
//setIconImage(new
ImageIcon(getClass().getResource("/iconos/hebreo.png")).getImage());
}
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Men Principal \"Optica Brakhot\"");
setAlwaysOnTop(true);
escritorioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGap(0, 537, Short.MAX_VALUE)
);
escritorioLayout.setVerticalGroup(
escritorioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADI
NG)
.addGap(0, 343, Short.MAX_VALUE)
);
jMenu3.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/iconos/documents-peoples-
pen.png"))); // NOI18N
jMenu3.setText("Administrar");
jMenuPaciente.setText("Paciente");
jMenuPaciente.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuPacienteActionPerformed(evt);
}
});
MPacienteNuevo.setText("Nuevo");
MPacienteNuevo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
MPacienteNuevoActionPerformed(evt);
}
});
jMenuPaciente.add(MPacienteNuevo);
MPacienteRConsulta.setText("Buscar");
MPacienteRConsulta.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
MPacienteRConsultaActionPerformed(evt);
}
});
jMenuPaciente.add(MPacienteRConsulta);
jMenu3.add(jMenuPaciente);
jMenuStock.setText("Stock");
jMenuStock.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuStockActionPerformed(evt);
}
});
jMenu3.add(jMenuStock);
jMenuBar1.add(jMenu3);
jMenu2.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/iconos/document-spreadsheet-
stick.png"))); // NOI18N
jMenu2.setText("Reportes");
jMenuRStock.setText("Stock");
jMenuRStock.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuRStockActionPerformed(evt);
}
});
jMenu2.add(jMenuRStock);
jMenuFichaOftalmica.setText("Ficha Oftalmica");
jMenuFichaOftalmica.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuFichaOftalmicaActionPerformed(evt);
}
});
jMenu2.add(jMenuFichaOftalmica);
jMenuSaludOcular.setText("Salud Ocular");
jMenuSaludOcular.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuSaludOcularActionPerformed(evt);
}
});
jMenu2.add(jMenuSaludOcular);
jMenuBar1.add(jMenu2);
jMenuHelp.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/iconos/Help.png"))); // NOI18N
jMenuHelp.setText("Ayuda");
jMenuHelp.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuHelpActionPerformed(evt);
}
});
jMenuIayuda.setText("Ayuda");
jMenuIayuda.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuIayudaActionPerformed(evt);
}
});
jMenuHelp.add(jMenuIayuda);
jMenuBar1.add(jMenuHelp);
setJMenuBar(jMenuBar1);
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(escritorio)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(escritorio)
);
pack();
}// </editor-fold>
private void
jMenuFichaOftalmicaActionPerformed(java.awt.event.ActionEvent evt) {
/* String noHistorial = JOptionPane.showInputDialog(this,"Ingrese el Nmero
de Historial");
if (noHistorial!=null){
if(!"".equals(noHistorial.trim())){
try{
JInternalFrame reporte = new JInternalFrame();
reporte.setSize(900,700);
reporte.setClosable(true);
reporte.setIconifiable(true);
reporte.setTitle("Reporte Ficha Oftalmologica Segn Nmero de
Historial");