Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Trabajos autonomos
1. ENTORNO NETBEANS
Diapositiva 1
ENTORNO DE
NETBEANS PROGRAMACIÓN VIII
MARLON ARANA
8 “B”
Diapositiva 2
NETBEANS
■ Netbeans es un entorno de desarrollo gratuito y de código abierto que
Permite el uso de un amplio rango de tecnologías de desarrollo tanto
para escritorio, como aplicaciones Web, o para dispositivos móviles.
Da soporte a las siguientes tecnologías, entre
otras: Java, PHP, Groovy, C/C++, HTML5,... Además puede instalarse
en varios sistemas operativos: Windows, Linux, Mac OS
Diapositiva 3
2. Entorno de Netbeans
■ Dentro del programa, una vez escogido la clase de proyecto en mi caso java
Application, encontramos la siguiente pantalla con las siguientes partes:
Diapositiva 4
Entorno de Netbeans
En este entorno se muestra las herramientas básicas para utilizar
Diapositiva 5
3. Entorno de Netbeans
■ En la anterior pantalla, se da nombre al proyecto y se escoge la ubicación donde se
va a guardar el proyecto, para una vez terminado el proyecto o código podamos
ejecutarlo con el botón verde, como muestra la imagen.
Diapositiva 6
Entorno de Netbeans
Aquí en la parte de profile
4. TRABAJO AUTONOMO MAYO
public class Operador_AND_ejercicio_a extends javax.swing.JFrame {
/**
* Creates new form Operador_AND_ejercicio_c
*/
public Operador_AND_ejercicio_a() {
initComponents();
}
/**
* 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() {
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
5. jLabel3 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel4.setText(" ");
jLabel5.setText("a = 5 y b = 15");
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel6.setText(" ");
jLabel1.setText("Operador AND");
jLabel2.setText("(a > 5) AND (b < a)");
jButton1.setText("Calcular");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel3.setText(" ");
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(144, 144, 144)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addGap(143, 143, 143)
7. pack();
}// </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int a=5,b=15;
jLabel3.setText(String.valueOf("("+a+" > "+a+")"+" AND "+"("+b+" < "+a+")"));
jLabel6.setText("Falso AND Falso");
jLabel4.setText("Falso");
// TODO add your handling code here:
}
/**
* @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(Operador_AND_ejercicio_a.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Operador_AND_ejercicio_a.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Operador_AND_ejercicio_a.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
8. } catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Operador_AND_ejercicio_a.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Operador_AND_ejercicio_a().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
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.JLabel jLabel6;
// End of variables declaration
}
9. Deber sentencias de control
Realizar un login con nombre y usuario, dentro de este debe haber un menú
• Diseñar y Generar los cinco formularios
• Crear las operaciones
package javaapplication2;
import javax.swing.JOptionPane;
public class NewJFrame extends javax.swing.JFrame {
public NewJFrame() {
initComponents();
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
10. jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
entrar = new javax.swing.JButton();
jTextField1 = new javax.swing.JTextField();
jpassClave = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText("usuario");
jLabel2.setText("contraseña");
entrar.setText("entrar");
entrar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
entrarActionPerformed(evt);
}
});
jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel3.setText("USUARIO");
jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fotos/12333.jpg"))); // NOI18N
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(55, 55, 55)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
12. .addComponent(jpassClave, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(entrar)
.addContainerGap(130, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
private void entrarActionPerformed(java.awt.event.ActionEvent evt) {
String usuario ="marlon", clave = "12345";
if (jTextField1.getText().equals(usuario) && jpassClave.getText().equals(clave)){
this.dispose();
JOptionPane.showMessageDialog(null, "Bienvenidon"
+ "Has ingresado satisfactoriamente al sistema", "Mensaje de bienvenida",
JOptionPane.INFORMATION_MESSAGE);
menu abrir=new menu();
abrir.setVisible(true);
}else {
JOptionPane.showMessageDialog(null, "Acceso denegado:n"
+ "Por favor ingrese un usuario y/o contraseña correctos", "Acceso denegado",
JOptionPane.ERROR_MESSAGE);
} // TODO add your handling code here:
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NewJFrame().setVisible(true);
}
});
}
13. // Variables declaration - do not modify
private javax.swing.JButton entrar;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jpassClave;
// End of variables declaration
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
double n1,r;
n1=Double.parseDouble(jTextField1.getText());
14. r=n1%2;
if(r==0)
jLabel2.setText("EL NUMERO "+n1+" ES: PAR");
else
jLabel2.setText("EL NUMERO "+n1+" ES: IMPAR");
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int a,b=1,c=0, resultado;
int num1=4;
int num2=2;
int num3=3;
int num4=10;
a=num1-num2;
for (int i=1; i<=3; i++)
{
b=b*a;
c=b*num1;
}
resultado= c+num4;
jTextField1.setText(String.valueOf(resultado));
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
float d,a,b=1, c=0, resultado;
15. float num1=4;
int num2=2;
int num3=3;
int num4=10;
float num5=6;
d= num5/num1;
a=d-num2;
for (int i=1; i<=3; i++)
{
b=b*a;
c=b*num1;
}
resultado= c+num4;
jTextField2.setText(String.valueOf(resultado));
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
double d,b,e,r, c=1, resultado;
double num2=3;
double a, num3=2 ;
int num1=7;
int num4=1;
d= num2/num3;
a=d+num4;
c=Math.pow(num3, a);
b=Math.pow(num2, c);
e=num1%num2;
resultado=b+e;
/*jTextField3.setText(String.valueOf(resultado));*/
jTextField3.setText(""+resultado);
16. ARREGLOS – VALIDACIÓN DE CÉDULA
Realizar una consulta sobre la validación de la cédula realizar el programa en java con
formularios con menú
private void jLabel5MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
String cedu=jTextField1.getText();
String [] division=cedu.split("");
int dg1,dg2,dg3,dg4,dg5,dg6,dg7,dg8,dg9;
int op1,op2,op3,op4,op5,op6,op7,op8,op9;
int suma=0, res=0, dgvericador;
19. private void jTextField1KeyTyped(java.awt.event.KeyEvent evt) {
int maximodeletras=10;
if(jTextField1.getText().length()>=maximodeletras){
evt.consume();
JOptionPane.showMessageDialog(rootPane, "Solo 10 Digitos");
}
JUEGO DE CARTAS
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int ne=0,i;
if (jCheckBox1.isSelected())
ne=ne+16;
if (jCheckBox2.isSelected())
ne=ne+32;
if (jCheckBox3.isSelected())
ne=ne+8;
if (jCheckBox4.isSelected())
ne=ne+1;
if (jCheckBox5.isSelected())
25. jLabel1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
btnC1 = new javax.swing.JButton();
btnC2 = new javax.swing.JButton();
btnC3 = new javax.swing.JButton();
btnC4 = new javax.swing.JButton();
btnC8 = new javax.swing.JButton();
btnC7 = new javax.swing.JButton();
btnC6 = new javax.swing.JButton();
btnC5 = new javax.swing.JButton();
btnC12 = new javax.swing.JButton();
btnC11 = new javax.swing.JButton();
btnC10 = new javax.swing.JButton();
btnC9 = new javax.swing.JButton();
btnC16 = new javax.swing.JButton();
btnC15 = new javax.swing.JButton();
btnC14 = new javax.swing.JButton();
btnC13 = new javax.swing.JButton();
btnReiniciar = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Juego Dos Caras");
jLabel1.setFont(new java.awt.Font("Tempus Sans ITC", 2, 18)); // NOI18N
jLabel1.setForeground(new java.awt.Color(255, 51, 51));
jLabel1.setText("JUEGO MEMORIA");
jPanel1.setBackground(new java.awt.Color(102, 153, 255));