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

Algo Ignovador

rocamado27 de Septiembre de 2014

3.318 Palabras (14 Páginas)264 Visitas

Página 1 de 14

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package ventanas;

//Declaración de objetos

import controladores.ControladorCentrosCostos;

import controladores.ControladorExpedientes;

import controladores.ControladorMovimientos;

import controladores.ControladorRazas;

import java.awt.Dimension;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.text.DateFormat;

import java.util.ArrayList;

import java.util.Date;

import java.util.Locale;

import javax.swing.BorderFactory;

import javax.swing.ButtonGroup;

import javax.swing.JButton;

import javax.swing.JComboBox;

import javax.swing.JLabel;

import javax.swing.JRadioButton;

import javax.swing.SwingConstants;

import javax.swing.border.TitledBorder;

import modelos.Ayuda;

import modelos.CajasTexto;

import modelos.Colores;

import modelos.Fuentes;

import modelos.Iconos;

import modelos.Interrupcion;

import modelos.Panel;

import modelos.Ventana;

import objetos.ObjetoCentroDeCosto;

import objetos.ObjetoExpedientes;

import objetos.ObjetoMovimientos;

import objetos.ObjetoRazas;

import org.jdesktop.swingx.JXDatePicker;

/**

*

* @author HP

*/

public class VentanaRegistrarGanado extends Ventana implements ActionListener {

//Declaración de objetos

private final Panel pnObjetos;

private final Panel pnDatosHato, pnDatosHatoGral, pnFoto, pnDesgaste;

private final JButton btAceptar, btCancelar, btAsignarPadreDuenio, btCartaVenta, btBitacora;

private final JLabel lbNoExpediente, lbNExpediente, lbNombre, lbSexo, lbRaza, lbEstado, lbColor, lbFechaNac, lbCentroCosto, lbAdquisicion, lbCosto, lbCouta, lbCoutasCumplidas, lbCoutaCumplidas;

private final CajasTexto tfNombre, tfColorHato, tfDesgaste, tfCosto;

private final JRadioButton rbMacho, rbHembra, rbNacido, rbComprado;

private final ButtonGroup bgSexo, bgAdquisicion;

private final int posxlbExpediente = 10, posxlbNombre = 10, posxlbSexo = 240, poslbRaza = 240, posxlbColor = 10, poslbEstado = 315, posxlbCosto = 240, posxlbDesgaste = 315, posxlbCentroCosto = 10, posxlbFechaNac = 10, posxlbAdquisicion = 10;

private final JXDatePicker clFecha;

private final JComboBox cbRaza, cbEstado, cbCentroCosto;

Ayuda pnAyudaPantalla;

public String sqlPadres;

public VentanaRegistrarGanado() {

super(new Dimension(700, 358), "Registro de Ganado", "Area de registro y actualización de expedientes");//700-313

//Implementación de objetos

pnAyudaPantalla = new Ayuda(10, 305, 655);

pnAyudaPantalla.agregarMensaje("Completar todos los campos", Ayuda.INFORMACION);

clFecha = new JXDatePicker();

clFecha.setFormats(DateFormat.getDateInstance(DateFormat.LONG, new Locale("es")));

clFecha.setDate(new Date());

//Etiquetas de la ventana

lbNoExpediente = new JLabel("N° Expediente :");

lbNExpediente = new JLabel("<html><b>9999</b></html>");

lbNombre = new JLabel("Nombre :");

lbSexo = new JLabel("Sexo :");

lbRaza = new JLabel("Raza :");

lbEstado = new JLabel("Estado :");

lbColor = new JLabel("Color :");

lbFechaNac = new JLabel("Nacimiento :");

lbCentroCosto = new JLabel("Centro de Costo :");

lbAdquisicion = new JLabel("Adquisicion :");

lbCosto = new JLabel("Costo :");

lbCouta = new JLabel("Cuota :");

lbCoutasCumplidas = new JLabel("Cumplidas :");

lbCoutaCumplidas = new JLabel("<html><b>9999</b></html>");

lbNoExpediente.setFont(Fuentes.fuente);

lbNExpediente.setFont(Fuentes.fuente);

lbNombre.setFont(Fuentes.fuente);

lbSexo.setFont(Fuentes.fuente);

lbRaza.setFont(Fuentes.fuente);

// lbHerrado.setFont(Fuentes.fuente);

lbEstado.setFont(Fuentes.fuente);

lbColor.setFont(Fuentes.fuente);

lbFechaNac.setFont(Fuentes.fuente);

lbCentroCosto.setFont(Fuentes.fuente);

lbAdquisicion.setFont(Fuentes.fuente);

lbCosto.setFont(Fuentes.fuente);

lbCouta.setFont(Fuentes.fuente);

lbCoutasCumplidas.setFont(Fuentes.fuente);

lbCoutaCumplidas.setFont(Fuentes.fuente);

lbNoExpediente.setForeground(Colores.colorTexto);

lbNExpediente.setForeground(Colores.colorTexto);

lbNombre.setForeground(Colores.colorTexto);

lbSexo.setForeground(Colores.colorTexto);

lbRaza.setForeground(Colores.colorTexto);

lbEstado.setForeground(Colores.colorTexto);

lbColor.setForeground(Colores.colorTexto);

lbFechaNac.setForeground(Colores.colorTexto);

lbCentroCosto.setForeground(Colores.colorTexto);

lbAdquisicion.setForeground(Colores.colorTexto);

lbCosto.setForeground(Colores.colorTexto);

lbCouta.setForeground(Colores.colorTexto);

lbCoutasCumplidas.setForeground(Colores.colorTexto);

lbCoutaCumplidas.setForeground(Colores.colorTexto);

//campos de texto de la ventana

tfNombre = new CajasTexto("Nombre", pnAyudaPantalla);

tfColorHato = new CajasTexto("Color", pnAyudaPantalla);

tfDesgaste = new CajasTexto("Desgaste", pnAyudaPantalla);

tfCosto = new CajasTexto("Costo", pnAyudaPantalla);

tfNombre.esObligatorio(true);

tfNombre.soloLetras(true);

tfColorHato.esObligatorio(true);

tfColorHato.soloLetras(true);

tfDesgaste.esObligatorio(true);

tfDesgaste.soloNumeros(true);

tfCosto.esObligatorio(true);

tfCosto.soloNumeros(true);

//botones

btAceptar = new JButton("Registrar", Iconos.imagenOk);

btCancelar = new JButton("Cancelar", Iconos.imagenCancelar);

btAsignarPadreDuenio = new JButton("Asignar padres", Iconos.imagenUsuario);

btCartaVenta = new JButton("Cartas de venta", Iconos.imagenExpediente);

btBitacora = new JButton("Bitacora", Iconos.imagenExpediente);

btAsignarPadreDuenio.setFont(Fuentes.fuente);

btCartaVenta.setFont(Fuentes.fuente);

btBitacora.setFont(Fuentes.fuente);

btAsignarPadreDuenio.setHorizontalAlignment(SwingConstants.LEFT);

btCartaVenta.setHorizontalAlignment(SwingConstants.LEFT);

btBitacora.setHorizontalAlignment(SwingConstants.LEFT);

bgSexo = new ButtonGroup();

rbMacho = new JRadioButton("Macho");

rbHembra = new JRadioButton("Hembra");

bgAdquisicion = new ButtonGroup();

rbNacido = new JRadioButton("Cria");

rbComprado = new JRadioButton("Compra");

rbNacido.setSelected(true);

rbMacho.setSelected(true);

rbMacho.setOpaque(false);

rbHembra.setOpaque(false);

rbNacido.setOpaque(false);

rbComprado.setOpaque(false);

rbMacho.setFont(Fuentes.fuente);

rbHembra.setFont(Fuentes.fuente);

rbNacido.setFont(Fuentes.fuente);

rbComprado.setFont(Fuentes.fuente);

rbMacho.setForeground(Colores.colorTexto);

rbHembra.setForeground(Colores.colorTexto);

rbNacido.setForeground(Colores.colorTexto);

rbComprado.setForeground(Colores.colorTexto);

cbRaza = new JComboBox();

cbEstado = new JComboBox();

cbCentroCosto = new JComboBox();

cbEstado.addItem("activo");

cbEstado.addItem("muerto");

cbEstado.addItem("enfermo");

pnObjetos = new Panel();

panelCentro.setLayout(null);

pnObjetos.setLayout(null);

panelCentro.add(pnObjetos);

// pnObjetos.setBackground(Color.WHITE);

pnObjetos.setBounds(10, 10, 680, 347);//680-302

//panel deFoto

pnFoto = new Panel();

pnDatosHato = new Panel();

pnDatosHatoGral = new Panel();

pnDesgaste = new Panel();

pnFoto.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Colores.colorBordeLinea),

...

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