ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

F_vededores

erikita25 de Enero de 2013

4.137 Palabras (17 Páginas)338 Visitas

Página 1 de 17

import javax.swing.SwingUtilities;

import java.awt.BorderLayout;

import javax.swing.JPanel;

import javax.swing.JFrame;

import java.awt.Toolkit;

import java.awt.Font;

import java.awt.Rectangle;

import java.awt.GridBagLayout;

import javax.swing.DefaultComboBoxModel;

import javax.swing.JTextField;

import javax.swing.JLabel;

import javax.swing.JButton;

import javax.swing.ImageIcon;

import javax.swing.BorderFactory;

import javax.swing.border.TitledBorder;

import java.awt.Color;

import javax.swing.*;

import base.conectarbdd;

import java.sql.Statement;

import java.sql.ResultSet;

//librerias para la fecha

import java.text.DecimalFormat;

import java.text.SimpleDateFormat;/// 4 librerias para la validación de la fecha

import java.text.ParseException;

import java.util.Calendar;

import java.util.Locale;

import java.awt.Dimension;

import java.awt.SystemColor;

// hasta aki

import base.conectarbdd;

import javax.swing.table.*;

import javax.swing.JCheckBox;

public class f_vendedores extends JFrame {

private static final long serialVersionUID = 1L;

private JPanel jContentPane = null;

private JPanel jPanel = null;

private JTextField txtcodigo = null;

private JLabel lblcodigo = null;

private JButton bprimero = null;

private JButton banterior = null;

private JButton bbuscar = null;

private JButton bsiguiente = null;

private JButton bultimo = null;

private JLabel lblnombre = null;

private JLabel lblapellido = null;

private JLabel lbldireccion = null;

private JLabel lblcedula = null;

private JLabel lbltelefono = null;

private JLabel lblfecha = null;

private JLabel lblemail = null;

private JLabel lblsexo = null;

private JLabel lblcelular = null;

private JLabel lblsueldo = null;

private JTextField txtnombres = null;

private JTextField txtapellidos = null;

private JTextField txtdireccion = null;

private JTextField txtcedula = null;

private JTextField txttelefono = null;

private JTextField txtfechaingreso = null;

private JTextField txtemail = null;

private JTextField txtcelular = null;

private JTextField txtsueldo = null;

private JButton bnuevo = null;

private JButton bmodificar = null;

private JButton bguardar = null;

private JButton bcancelar = null;

private JButton beliminar = null;

private JButton bsalir = null;

private JPanel jPanel1 = null;

private JComboBox cbsexo = null;

private JPanel jPanel2 = null;

private JLabel jLabel10 = null;

// deckaracion de variables

conectarbdd conexion =new conectarbdd();///declarando un objeto que va esta basado en la clase bd / // objeto para conectar de clase Connection // @jve:decl-index=0:

Statement sentencia,sentenciaxreg,sentenciaventas; // objeto basado en la clase Statement // @jve:decl-index=0:

ResultSet resultado,resultadoxreg,resultadoventas;// objeto basa do enlaclase va tomar los resulatados de la clase sql cuando se trabaje con SELECT // @jve:decl-index=0:

boolean nuevoreg; //para saber si se esta ingresando nuevos datos o se va a modificar los datos

int xregistros;

Calendar lafecha=Calendar.getInstance(); // @jve:decl-index=0:

boolean punto;

String elcodigo= new String(); // @jve:decl-index=0:

int cont=0;

int activo;

DecimalFormat redondear = new DecimalFormat("0.00");

private JLabel lblventas = null;

private JLabel lbllaboral = null;

private JLabel lblfecha1 = null;

private JTextField txtfechanac = null;

private JTextField txtventas = null;

private JCheckBox chklaboral = null;

/**

* This method initializes jPanel

*

* @return javax.swing.JPanel

*/

private JPanel getJPanel() {

if (jPanel == null) {

lblcodigo = new JLabel();

lblcodigo.setFont(new Font("Broadway", Font.BOLD, 14));

lblcodigo.setBackground(Color.gray);

lblcodigo.setBounds(new Rectangle(5, 10, 88, 27));

lblcodigo.setEnabled(true);

lblcodigo.setText("CODIGO");

jPanel = new JPanel();

jPanel.setLayout(null);

jPanel.setBounds(new Rectangle(10, 16, 243, 47));

jPanel.setBackground(Color.lightGray);

jPanel.add(getTxtcodigo(), null);

jPanel.add(lblcodigo, null);

}

return jPanel;

}

/**

* This method initializes txtcodigo

*

* @return javax.swing.JTextField

*/

private JTextField getTxtcodigo() {

if (txtcodigo == null) {

txtcodigo = new JTextField();

txtcodigo.setBounds(new Rectangle(101, 9, 136, 29));

txtcodigo.setDisabledTextColor(Color.darkGray);

txtcodigo.setFont(new Font("Comic Sans MS", Font.PLAIN, 12));

txtcodigo.setEnabled(false);

}

return txtcodigo;

}

/**

* This method initializes bprimero

*

* @return javax.swing.JButton

*/

private JButton getBprimero() {

if (bprimero == null) {

bprimero = new JButton();

bprimero.setIcon(new ImageIcon("C:/PROYECTO INVENTARIO_e/IMAGENES/IMAGINES/icono de sguiente.jpg"));

bprimero.setToolTipText("Primer Cliente");

bprimero.setBounds(new Rectangle(4, 4, 59, 57));

bprimero.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent e) {

try{

resultado.first();

actualizar();

}

catch(Exception f){

}

}

});

}

return bprimero;

}

/**

* This method initializes banterior

*

* @return javax.swing.JButton

*/

private JButton getBanterior() {

if (banterior == null) {

banterior = new JButton();

banterior.setIcon(new ImageIcon("C:/PROYECTO INVENTARIO_e/IMAGENES/siguientes2.jpg"));

banterior.setToolTipText("Anterior Cliente");

banterior.setBounds(new Rectangle(65, 4, 52, 57));

banterior.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent e) {

try{

if (resultado.isBeforeFirst()==false){

resultado.previous();

if (resultado.isBeforeFirst()==true)

{

resultado.first();

}

actualizar();

}

}

catch (Exception p){

}

}

});

}

return banterior;

}

/**

* This method initializes bbuscar

*

* @return javax.swing.JButton

*/

private JButton getBbuscar() {

if (bbuscar == null) {

bbuscar = new JButton();

bbuscar.setIcon(new ImageIcon("C:/PROYECTO INVENTARIO_e/IMAGENES/IMAGINES/buscar1399.jpg"));

bbuscar.setToolTipText("Buscar Cliente");

bbuscar.setBounds(new Rectangle(119, 4, 56, 57));

bbuscar.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent e) {

new f_listavendedores().setVisible(true);

if(f_listavendedores.seleccionaven==true){

elcodigo=f_listavendedores.codigoven;

encuentra();}

}

});

}

dispose();

return bbuscar;

}

/**

* This method initializes bsiguiente

*

* @return javax.swing.JButton

*/

private JButton getBsiguiente() {

if (bsiguiente == null) {

bsiguiente = new JButton();

bsiguiente.setIcon(new ImageIcon("C:/PROYECTO INVENTARIO_e/IMAGENES/IMAGINES/siguiente 3.jpg"));

bsiguiente.setToolTipText("Siguiente Cliente");

bsiguiente.setBounds(new Rectangle(178, 4, 56, 58));

bsiguiente.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent e) {

try{

if (resultado.isAfterLast()==false){

resultado.next();

if (resultado.isAfterLast()==true)

{

resultado.last();

}

actualizar();

}

}

catch (Exception

...

Descargar como (para miembros actualizados) txt (46 Kb)
Leer 16 páginas más »
Disponible sólo en Clubensayos.com