You are on page 1of 21

PAQUQTE 1 CLASE 1 PRESENTACION * To change this template, choose Tools | Templates * and open the template in the editor.

*/ package simulador; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Timer; /** * * @author Anthony */ public class Presentacion extends javax.swing.JFrame { private static final long serialVersionUID = 1L; //Inicializando los parametros private Timer tiempo; private int cont; public final static int ONE_SECOND = 30; /** * Creates new form Presentacion */ public Presentacion() { initComponents(); getContentPane().setBackground(new java.awt.Color(148,148,142)); cont =-1; jProgressBar1.setValue(0); jProgressBar1.setStringPainted(true); tiempo = new Timer(ONE_SECOND, new TimerListener()); tiempo.start(); } void CargarIdioma(String espanoL) { } class TimerListener implements ActionListener { public void actionPerformed(ActionEvent evt) { cont++; // jLabel1.setText("nume es :"+cont); jProgressBar1.setValue(cont); if(cont==160) { tiempo.stop(); esconder(); //JFrame World = new Word(); //World.setVisible(true); //World.show(); Ventana ventana = new Ventana(); ventana.setLocationRelativeTo(null); ventana.setVisible(true); } }

} public void esconder() { this.setVisible(false); } public void activar() { tiempo.start(); } /** * 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"> private void initComponents() { jProgressBar1 = new javax.swing.JProgressBar(); jLabel2 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jProgressBar1.setForeground(new java.awt.Color(102, 0, 0)); jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image nes/SIMULADORDEBATEO.gif"))); // NOI18N jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image nes/ing sistemas.png"))); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentP ane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING ) .addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, j avax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addGap(280, 280, 280) .addComponent(jLabel1) .addContainerGap(280, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createS equentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX _VALUE) .addComponent(jLabel2) .addGap(48, 48, 48)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING ) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createS equentialGroup()

.addGap(56, 56, 56) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 2 58, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELA TED, 64, Short.MAX_VALUE) .addComponent(jLabel2) .addGap(18, 18, 18) .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_S IZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) ); pack(); }// </editor-fold> /** * @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 cod e (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.h tml */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIMana ger.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Presentacion.class.getName()).log (java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Presentacion.class.getName()).log (java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Presentacion.class.getName()).log (java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Presentacion.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 Presentacion().setVisible(true); }

}); } // Variables declaration - do not modify private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JProgressBar jProgressBar1; // End of variables declaration }

CLASE 2 VENTANA /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package simulador; import import import import Propiedades.Idioma; java.awt.Graphics; java.awt.Point; java.util.Properties;

/** * * @author francisco */ public class Ventana extends javax.swing.JFrame { String msj, tituloMsj, btnJOption; private Graphics lienzo; int cont =0; boolean inicio = true; Point pinicio = new Point(); /** * Creates new form Ventana */ public Ventana() { initComponents(); lienzo = getGraphics(); pich.setVisible(true); bate.setVisible(true); lineal.setVisible(false); lineal2.setVisible(false); lineal3.setVisible(false); lineal4.setVisible(false); } public void MultiLenguaje() { initComponents(); jMenuItemEspanol.setSelected(true); this.setLocationRelativeTo(null); } public void CargarIdioma(String idioma) {

Properties propiedades = new Idioma(idioma); //Titulo del frame this.setTitle(propiedades.getProperty("Titulo")); jMenuArchivo.setText(propiedades.getProperty("Archivo")); jMenuItemSalir.setText(propiedades.getProperty("Salir")); jMenuEditar.setText(propiedades.getProperty("Editar")); jMenuIdioma.setText(propiedades.getProperty("Idioma")); jMenuItemEspanol.setText(propiedades.getProperty("Espaol")); jMenuItemIngles.setText(propiedades.getProperty("Ingles")); jMenuAyuda.setText(propiedades.getProperty("Ayuda")); jMenuItemManual.setText(propiedades.getProperty("Manual")); jMenuItemAcerca.setText(propiedades.getProperty("Acercade")); jMenuItemGraficas.setText(propiedades.getProperty("Graficas")); jButtoniniciar.setText(propiedades.getProperty("iniciar")); jButtonstop.setText(propiedades.getProperty("detener")); } /** * 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"> private void initComponents() { jButtoniniciar = new javax.swing.JButton(); jButtonstop = new javax.swing.JButton(); bate = new javax.swing.JLabel(); pich = new javax.swing.JLabel(); lineal = new javax.swing.JLabel(); lineal2 = new javax.swing.JLabel(); lineal3 = new javax.swing.JLabel(); lineal4 = new javax.swing.JLabel(); campo = new javax.swing.JLabel(); jMenuBar1 = new javax.swing.JMenuBar(); jMenuArchivo = new javax.swing.JMenu(); jMenuItemSalir = new javax.swing.JMenuItem(); jMenuEditar = new javax.swing.JMenu(); jMenuIdioma = new javax.swing.JMenu(); jMenuItemEspanol = new javax.swing.JMenuItem(); jMenuItemIngles = new javax.swing.JMenuItem(); jMenuAyuda = new javax.swing.JMenu(); jMenuItemManual = new javax.swing.JMenuItem(); jMenuItemAcerca = new javax.swing.JMenuItem(); jMenuItemGraficas = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Simulador De Bateo"); setBackground(new java.awt.Color(26, 157, 53)); addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { formMouseClicked(evt); } }); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout( ));

jButtoniniciar.setText("Iniciar"); jButtoniniciar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtoniniciarActionPerformed(evt); } }); getContentPane().add(jButtoniniciar, new org.netbeans.lib.awtextra.Absol uteConstraints(20, 10, -1, -1)); jButtonstop.setText("Detener"); jButtonstop.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonstopActionPerformed(evt); } }); getContentPane().add(jButtonstop, new org.netbeans.lib.awtextra.Absolute Constraints(100, 10, -1, -1)); bate.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes /Besibolewf.png"))); // NOI18N getContentPane().add(bate, new org.netbeans.lib.awtextra.AbsoluteConstra ints(130, 160, -1, -1)); pich.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes /Tirador2.png"))); // NOI18N getContentPane().add(pich, new org.netbeans.lib.awtextra.AbsoluteConstra ints(520, 190, -1, -1)); lineal.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagen es/lineal2.gif"))); // NOI18N getContentPane().add(lineal, new org.netbeans.lib.awtextra.AbsoluteConst raints(0, 0, 1100, 600)); lineal2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image nes/lineal3.gif"))); // NOI18N getContentPane().add(lineal2, new org.netbeans.lib.awtextra.AbsoluteCons traints(0, 0, -1, 600)); lineal3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image nes/lineal4.gif"))); // NOI18N getContentPane().add(lineal3, new org.netbeans.lib.awtextra.AbsoluteCons traints(0, 0, 1100, 600)); lineal4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image nes/lineal5.gif"))); // NOI18N getContentPane().add(lineal4, new org.netbeans.lib.awtextra.AbsoluteCons traints(0, 0, 1100, -1)); campo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagene s/Campo 2.png"))); // NOI18N getContentPane().add(campo, new org.netbeans.lib.awtextra.AbsoluteConstr aints(0, 0, 1110, 600)); jMenuArchivo.setText("Archivo"); jMenuItemSalir.setText("Salir"); jMenuItemSalir.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemSalirActionPerformed(evt); }

}); jMenuArchivo.add(jMenuItemSalir); jMenuBar1.add(jMenuArchivo); jMenuEditar.setText("Editar"); jMenuIdioma.setText("Idioma"); jMenuItemEspanol.setText("Espaol"); jMenuItemEspanol.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemEspanolActionPerformed(evt); } }); jMenuIdioma.add(jMenuItemEspanol); jMenuItemIngles.setText("Ingles"); jMenuItemIngles.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemInglesActionPerformed(evt); } }); jMenuIdioma.add(jMenuItemIngles); jMenuEditar.add(jMenuIdioma); jMenuBar1.add(jMenuEditar); jMenuAyuda.setText("Ayuda"); jMenuItemManual.setText("Manual"); jMenuItemManual.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemManualActionPerformed(evt); } }); jMenuAyuda.add(jMenuItemManual); jMenuItemAcerca.setText("Acerca de..."); jMenuItemAcerca.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemAcercaActionPerformed(evt); } }); jMenuAyuda.add(jMenuItemAcerca); jMenuItemGraficas.setText("Graficas"); jMenuItemGraficas.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItemGraficasActionPerformed(evt); } }); jMenuAyuda.add(jMenuItemGraficas); jMenuBar1.add(jMenuAyuda); setJMenuBar(jMenuBar1);

pack(); }// </editor-fold> private void jButtoniniciarActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: cont++; if(cont ==1){ pich.setVisible(false); bate.setVisible(false); lineal.setVisible(true); lineal2.setVisible(false); lineal3.setVisible(false); lineal4.setVisible(false); } else{ if(cont ==2){ pich.setVisible(false); bate.setVisible(false); lineal.setVisible(false); lineal2.setVisible(true); lineal3.setVisible(false); lineal4.setVisible(false); } else{ if(cont ==3){ pich.setVisible(false); bate.setVisible(false); lineal.setVisible(false); lineal2.setVisible(false); lineal3.setVisible(true); lineal4.setVisible(false); } else{ if(cont ==4){ pich.setVisible(false); bate.setVisible(false); lineal.setVisible(false); lineal2.setVisible(false); lineal3.setVisible(false); lineal4.setVisible(true); } else{ } } } } } private void jButtonstopActionPerformed(java.awt.event.ActionEvent evt) { pich.setVisible(true); bate.setVisible(true); lineal.setVisible(false); lineal2.setVisible(false); lineal3.setVisible(false); lineal4.setVisible(false);

} private void jMenuItemSalirActionPerformed(java.awt.event.ActionEvent evt) { System.exit(0); } private void jMenuItemEspanolActionPerformed(java.awt.event.ActionEvent evt) { CargarIdioma("ESPANOL"); } private void jMenuItemInglesActionPerformed(java.awt.event.ActionEvent evt) { CargarIdioma("INGLES"); } private void jMenuItemAcercaActionPerformed(java.awt.event.ActionEvent evt) { About isvb = new About(); isvb.setVisible(true); } private void formMouseClicked(java.awt.event.MouseEvent evt) { /**if(inicio == true) { pinicio.x = evt.getX(); pinicio.y = evt.getY(); inicio = false; } else { Graphics lienzo = getGraphics(); lienzo.drawOval(pinicio.x, pinicio.y, 4, 4); lienzo.drawOval(evt.getX(), evt.getY(), 4, 4); lienzo.drawLine(pinicio.x, pinicio.y, evt.getX(), evt.getY()); inicio = true; }*/ } private void jMenuItemManualActionPerformed(java.awt.event.ActionEvent evt) { Ayuda manual = new Ayuda(); manual.setVisible(true); } private void jMenuItemGraficasActionPerformed(java.awt.event.ActionEvent evt ) { Graficas grafica = new Graficas(); grafica.setVisible(true); } // Variables declaration - do not modify private javax.swing.JLabel bate; private javax.swing.JLabel campo; private javax.swing.JButton jButtoniniciar; private javax.swing.JButton jButtonstop; private javax.swing.JMenu jMenuArchivo;

private javax.swing.JMenu jMenuAyuda; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenu jMenuEditar; private javax.swing.JMenu jMenuIdioma; private javax.swing.JMenuItem jMenuItemAcerca; private javax.swing.JMenuItem jMenuItemEspanol; private javax.swing.JMenuItem jMenuItemGraficas; private javax.swing.JMenuItem jMenuItemIngles; private javax.swing.JMenuItem jMenuItemManual; private javax.swing.JMenuItem jMenuItemSalir; private javax.swing.JLabel lineal; private javax.swing.JLabel lineal2; private javax.swing.JLabel lineal3; private javax.swing.JLabel lineal4; private javax.swing.JLabel pich; // End of variables declaration }

CLASE 3 AYUDA /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package simulador; /** * * @author Anthony */ public class Ayuda extends javax.swing.JFrame { /** * Creates new form Ayuda */ public Ayuda() { setPreferredSize(new java.awt.Dimension(1280,1024)); initComponents(); jTextArea1.append('\t'+" MANUAL DE APOYO" + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"Espaol" + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"En la barra de opcin se encuentra:" + '\n'); jTextArea1.append('\t'+"Archivo--Salir" + '\n'); jTextArea1.append('\t'+"Editar--Idiomas" + '\n'); jTextArea1.append('\t'+"Ayuda--Manual" + '\n'); jTextArea1.append('\t'+"1.- Oprime una vez el botn iniciar para ver la f uncin lineal del baln" + '\n'); jTextArea1.append('\t'+"Funcion Lineal " + '\n'); jTextArea1.append('\t'+"Definicin:" + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+" Una funcin lineal se expresa mediante la frmula f (x)= mx + b donde b y m son constantes que representan la ordenada al origen y l a pendiente." + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"Grafica:" + '\n');

jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"La pendiente muestra cuanto vara la funcin por cad a unidad de x. " + '\n'); jTextArea1.append('\t'+"La pendiente es la tangente del ngulo que se form a entre los dos catetos, es decir entre b y x. La frmula para calcularla es m = b / x. " + '\n'); jTextArea1.append('\t'+"Las funciones lineales representan casos de prop orcionalidad directa como el Movimiento rectilneo uniforme (MRU) " + '\n'); jTextArea1.append('\t'+"Su dominio es el de todos los nmeros reales. " + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"Funcion Seno" + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"2.- Oprime el botn iniciar por segunda vez se mos trar el trayecto de la funcin." + '\n'); jTextArea1.append('\t'+"Como la medida en radianes de un ngulo orientado es un nmero real, podemos definir la funcin de un nmero real." + '\n'); jTextArea1.append('\t'+"La funcin f(x) = sen x, cuyo dominio es, asigna a cada nmero real x el seno de ese nmero." + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"Grafica:" + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append("Traduccin Espaol-Ingles:"+'\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"In the pull-down menu in the option: " + '\n'); jTextArea1.append('\t'+"Files-- Out" + '\n'); jTextArea1.append('\t'+"Edit--languages" + '\n'); jTextArea1.append('\t'+"Help--Manual" + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"1.- Press star button once to see the Linear Fun tion of the ball " + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"Definition" + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"A linear funtion is expressend by the formula f( x)= mx+b. " + "Where b and m are constants representing the i ntercept and slope." + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"Graphics " + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"The slope shows how the function varies for each unit of x. " + '\n'); jTextArea1.append('\t'+"The slope is the tangent of the angle formed bet ween the two legs, ie between by x. Calculation formula is m = b / x." + '\n'); jTextArea1.append('\t'+"Linear functions represent cases of direct propo rtionality as uniform rectilinear motion (MRU) " + '\n'); jTextArea1.append('\t'+"Can be represented by formulas, graphs and table s. " + '\n'); jTextArea1.append('\t'+"Its domain is all real numbers." + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"2. - Press the start button a second time will d isplay the path of the function." + '\n'); jTextArea1.append('\t'+"As the measure of an angle in radians oriented i s a real number, we can define the function of a real number." + '\n');

jTextArea1.append('\t'+"The function f (x) = sin x." + " whose domain is assigned to each real number x within that number." + '\n'); jTextArea1.append('\t'+" " + '\n'); jTextArea1.append('\t'+"Graphics " + '\n'); } /** * 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"> private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jButtonRegresar = new javax.swing.JButton(); Graficas = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane1.setViewportView(jTextArea1); jButtonRegresar.setText("Regresar"); jButtonRegresar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonRegresarActionPerformed(evt); } }); Graficas.setText("Graficas"); Graficas.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { GraficasActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentP ane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING ) .addGroup(layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SI ZE, 824, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali gnment.TRAILING) .addComponent(jButtonRegresar) .addComponent(Graficas)) .addContainerGap(37, Short.MAX_VALUE)) ); layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING ) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILI NG, javax.swing.GroupLayout.DEFAULT_SIZE, 184, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jButtonRegresar) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRE LATED) .addComponent(Graficas) .addContainerGap()) ); pack(); }// </editor-fold> private void jButtonRegresarActionPerformed(java.awt.event.ActionEvent evt) { this.dispose(); } private void GraficasActionPerformed(java.awt.event.ActionEvent evt) { //Graficas grafica = new Graficas(); // grafica.setVisible(true); } /** * @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 cod e (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.h tml */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIMana ger.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Ayuda.class.getName()).log(java.u til.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Ayuda.class.getName()).log(java.u til.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Ayuda.class.getName()).log(java.u til.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(Ayuda.class.getName()).log(java.u til.logging.Level.SEVERE, null, ex); } //</editor-fold> /* * Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Ayuda().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton Graficas; private javax.swing.JButton jButtonRegresar; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextArea1; // End of variables declaration } CLASE 4 ECUACIONES /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package simulador; import java.util.ArrayList; import java.util.Random; /** * * @author francisco */ public class Ecuaciones { private Random aleatorio; private ArrayList<Integer> ecuacion; public Ecuaciones() { aleatorio = new Random(); ecuacion = new ArrayList<>(); } public ArrayList ecuacionGenerada() { ecuacion.add(aleatorio.nextInt(400) + 1); ecuacion.add(aleatorio.nextInt(200) + 1); return ecuacion; } public Integer evaluarEcuacion(Integer x) { Integer resultado = 0;

for(int i = 0; i < ecuacion.size(); i++) resultado = ecuacion.get(i)*x*x*x; return resultado; } }

GRAFICAS /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package simulador; /** * * @author Anthony y Eduardo */ public class Graficas extends javax.swing.JFrame { /** * Creates new form Graficas */ public Graficas() { initComponents(); setPreferredSize(new java.awt.Dimension(1280,724)); } /** * 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"> private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jButtonRegresar = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jPanel4 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jPanel5 = new javax.swing.JPanel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout( ));

jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Fu ncin Lineal", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing. border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Agency FB", 0, 24), new java.awt.Color(102, 0, 0))); // NOI18N jPanel2.setLayout(null); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image nes/Lineal.png"))); // NOI18N jLabel1.setToolTipText(""); jPanel2.add(jLabel1); jLabel1.setBounds(10, 30, 600, 230); jPanel1.add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(1 0, 110, 630, 270)); jButtonRegresar.setBackground(new java.awt.Color(212, 212, 132)); jButtonRegresar.setText("Regresar"); jButtonRegresar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonRegresarActionPerformed(evt); } }); jPanel1.add(jButtonRegresar, new org.netbeans.lib.awtextra.AbsoluteConst raints(1190, 30, -1, -1)); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Fu ncin Cubica", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing. border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Agency FB", 0, 24), new java.awt.Color(102, 0, 0))); // NOI18N jPanel3.setLayout(null); jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image nes/Cubica.png"))); // NOI18N jPanel3.add(jLabel2); jLabel2.setBounds(20, 30, 600, 240); jPanel1.add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(6 60, 100, 640, 280)); jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Fu ncin Cuadrtica", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swin g.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Agency FB", 0, 24), n ew java.awt.Color(102, 0, 0))); // NOI18N jPanel4.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image nes/Cuadratica.png"))); // NOI18N jPanel4.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(2 0, 50, 590, 230)); jPanel1.add(jPanel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(0 , 400, 630, 290)); jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Fu ncin Seno", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.bo rder.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Agency FB", 0, 24), new j ava.awt.Color(102, 0, 0))); // NOI18N

jPanel5.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image nes/Sin x.png"))); // NOI18N jPanel5.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(2 0, 30, 600, 250)); jPanel1.add(jPanel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(6 60, 400, 640, 300)); jLabel5.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N jLabel5.setForeground(new java.awt.Color(0, 51, 153)); jLabel5.setText("Representacin grafica de los lanzamiento."); jPanel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(2 00, 20, 810, 50)); jScrollPane1.setViewportView(jPanel1); getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.Absolut eConstraints(0, 0, 1330, 730)); pack(); }// </editor-fold> private void jButtonRegresarActionPerformed(java.awt.event.ActionEvent evt) { this.dispose(); } /** * @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 cod e (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.h tml */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIMana ger.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Graficas.class.getName()).log(jav a.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Graficas.class.getName()).log(jav a.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Graficas.class.getName()).log(jav

a.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Graficas.class.getName()).log(jav a.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* * Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Graficas().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButtonRegresar; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JScrollPane jScrollPane1; // End of variables declaration } CLASE 5 ABOUT /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package simulador; import javax.swing.JPanel; import javax.swing.JTextArea; /** * * @author legion23 */ public class About extends javax.swing.JFrame { /** * Creates new form About */ public About() { initComponents(); jTextArea1.append('\n'+"Version del Software:" + '\n'+ '\t' +"#####" + ' \n'); jTextArea1.append("Fecha de Creacin:" + '\n'+ '\t' +"#####" + '\n'); jTextArea1.append("Desarrolladores:"+'\n');

jTextArea1.append('\t'+"Eliseo Refugio Hernndez" + '\n'); jTextArea1.append('\t'+"Wendy Yadira Rodriguez Tzeek" + '\n'); jTextArea1.append('\t'+"Rosbelia del Carmen Antonio" + '\n'); jTextArea1.append('\t'+"Miguelina Garcia Gomez" + '\n'); jTextArea1.append('\t'+"Nelly del Carmen Palacio Canepa" + '\n'); jTextArea1.append('\t'+"Jorge Luis May Sanchez" + '\n'); jTextArea1.append('\t'+"Cesar Antonio Hernandez Geronimo" + '\n'); jTextArea1.append('\t'+"Luis Felipe Chico Barrio " + '\n'); jTextArea1.append('\t'+"Carlos Eduardo Espino Guevara " + '\n'); jTextArea1.append('\t'+"Jose Jesus Landeros Galindo " + '\n'); jTextArea1.append('\t'+"Neftali Ramirez Justo " + '\n'); jTextArea1.append('\t'+"Carlos Alfredo Baos Osorio " + '\n'); jTextArea1.append('\t'+"Leandro Mariano Alvarez Canales " + '\n'); jTextArea1.append('\t'+"Claudio Manuel Perez Collado " + '\n'); jTextArea1.append('\t'+"Valentin Guillermo Garcia " + '\n'); jTextArea1.append('\t'+"Victor Hugo Rodriguez Ehuan" + '\n'); jTextArea1.append('\t'+"Fernando Enrique Moreno Hernandez" + '\n'); jTextArea1.append('\t'+"Luis David Caballero Sosa" + '\n'); jTextArea1.append('\t'+" "+'\n'); jTextArea1.append("Traduccin Espaol-Ingles:"+'\n'); jTextArea1.append('\t'+"Eliseo Refugio Hernndez" + '\n'); jTextArea1.append('\t'+"Wendy Yadira Rodriguez Tzeek" + '\n'); jTextArea1.append('\t'+"Rosbelia del Carmen Antonio" + '\n'); jTextArea1.append('\t'+"Miguelina Garcia Gomez" + '\n'); jTextArea1.append('\t'+"Nelly del Carmen Palacio Canepa" + '\n'); jTextArea1.append('\t'+"Jorge Luis May Sanchez" + '\n'); jTextArea1.append('\t'+"Cesar Antonio Hernandez Geronimo" + '\n'); jTextArea1.append('\t'+"Luis Felipe Chico Barrio " + '\n'); jTextArea1.append('\t'+"Carlos Eduardo Espino Guevara " + '\n'); jTextArea1.append('\t'+"Jose Jesus Landeros Galindo " + '\n'); jTextArea1.append('\t'+"Neftali Ramirez Justo " + '\n'); jTextArea1.append('\t'+"Carlos Alfredo Baos Osorio " + '\n'); jTextArea1.append('\t'+"Leandro Mariano Alvarez Canales " + '\n'); jTextArea1.append('\t'+"Claudio Manuel Perez Collado " + '\n'); jTextArea1.append('\t'+"Valentin Guillermo Garcia " + '\n'); jTextArea1.append('\t'+"Victor Hugo Rodriguez Ehuan" + '\n'); jTextArea1.append('\t'+"Fernando Enrique Moreno Hernandez" + '\n'); jTextArea1.append('\t'+"Luis David Caballero Sosa" + '\n'); }

/** * @param args the command line arguments */ public static void main(String args[]) { /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new About().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextArea1; // End of variables declaration

} CLASE 6 MAIN /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package simulador; /** * * @author francisco */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { Presentacion chonita = new Presentacion(); chonita.CargarIdioma("ESPANOL"); chonita.setLocationRelativeTo(null); chonita.setVisible(true); /* About nombres = new About(); nombres.setVisible(true);*/ } } PAQUETE 2 PROPIEDADES CLASE 1 ESPAOL Titulo=Simulador de Bateo Archivo=Archivo Salir=Salir Editar=Editar Idioma=Idioma Espaol=Espaol Ingles=Ingles Ayuda=Ayuda Manual=Manual Acercade=Acerca de... Graficas=Graficas pintar=Pintar iniciar=Iniciar detener=Detener CLASE 2 TRADUCCION /*

* To change this template, choose Tools | Templates * and open the template in the editor. */ package Propiedades; import java.io.IOException; import java.util.Properties; /** * * @author legion23 */ public class Idioma extends Properties{ public Idioma (String idioma){ if (idioma.equals("ESPANOL")) { getProperties("Espanol.properties"); } else if (idioma.equals("INGLES")) { getProperties("Ingles.properties"); } else { getProperties("ESPANOL"); } } /* se leen las propiedades */ private void getProperties(String idioma) { try { this.load(getClass().getResourceAsStream(idioma)); } catch (IOException ex) { } }

} CLASE 3 INGLES # To change this template, choose Tools | Templates # and open the template in the editor. Titulo=Batting Simulator Archivo=File Salir=Close Editar=Edit Idioma=Language Espaol=Spanish Ingles=English Ayuda=Help Manual=Manual Acercade=About Graficas=Graphics pintar=Paint iniciar=Start detener=Stop