Sie sind auf Seite 1von 5

MANUAL DEL

PROGRAMADOR
Módulo de animales

En este módulo se escuchan los nombres de los animales y los sonidos que emiten en los tres
idiomas únicamente se debe seleccionar la bandera del idioma que dese escuchar.
package Animals;

import static escolar.Animal.band;


import static escolar.Animal.bima;
import java.io.File;
import javafx.embed.swing.JFXPanel;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;

/**
*
* @author betti
*/
public class bird extends javax.swing.JFrame {
/**
* Creates new form bird
*/
public bird() {
initComponents();
setLocationRelativeTo(null);
}

/**
* 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() {

jLabel1 = new javax.swing.JLabel();


jPanel1 = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setMaximumSize(new java.awt.Dimension(800, 650));
setMinimumSize(new java.awt.Dimension(800, 650));
setUndecorated(true);
setPreferredSize(new java.awt.Dimension(800, 650));
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/cierra.png"))); //
NOI18N
jLabel1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel1MouseClicked(evt);
}
});
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(710, 0, -1,
90));

jPanel1.setBackground(new java.awt.Color(255, 255, 255));


jPanel1.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 2, true));
jPanel1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

jLabel3.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/Animals/bird_1.png"))); // NOI18N
jLabel3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel3MouseClicked(evt);
}
});
jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 60, -1, -1));

getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 90, 800,


700));

jLabel5.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/Apane/fondo2.png"))); // NOI18N
jLabel5.setText("jLabel5");
getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 800,
-1));

pack();
}// </editor-fold>

private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {


this.setVisible(false);
}
private void jLabel3MouseClicked(java.awt.event.MouseEvent evt) {
if(band==1){
try {
new JFXPanel();
String son=new File("plumita.m4a").toURI().toString();
new MediaPlayer(new Media(son)).play();
} catch (Exception e) {
}
}
if(band==2){
try {
new JFXPanel();
String son=new File("plumita-in.m4a").toURI().toString();
new MediaPlayer(new Media(son)).play();
} catch (Exception e) {
}
}
if(band==3){
try {
new JFXPanel();
String son=new File("plumita-fran.m4a").toURI().toString();
new MediaPlayer(new Media(son)).play();
} catch (Exception e) {
}
}
}

/**
* @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(bird.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(bird.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(bird.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(bird.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 bird().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel5;
private javax.swing.JPanel jPanel1;
// End of variables declaration
}

Das könnte Ihnen auch gefallen