SlideShare ist ein Scribd-Unternehmen logo
1 von 10
import java.awt.BorderLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.*;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.*;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
public class InterfazEmpleado extends JFrame
{
private PanelDatos panelDatos;
private PanelSalario panelSalario;
private PanelConsultas panelConsultas;
private PanelExtensiones panelExtensiones;
public InterfazEmpleado( )
{
setTitle( "Sistema de Empleados" );
JPanel panelCentral = new JPanel( );
panelDatos = new PanelDatos( );
panelSalario = new PanelSalario( );
panelConsultas = new PanelConsultas( );
panelExtensiones = new PanelExtensiones( );
getContentPane( ).add( panelDatos, BorderLayout.NORTH );
getContentPane( ).add( panelCentral, BorderLayout.CENTER );
getContentPane( ).add( panelExtensiones, BorderLayout.SOUTH );
panelCentral.setLayout( new BorderLayout( ) );
panelCentral.add( panelSalario, BorderLayout.NORTH );
panelCentral.add( panelConsultas, BorderLayout.CENTER );
setSize( 530, 530 );
setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
}
public static void main( String[] args )
{
InterfazEmpleado femp = new InterfazEmpleado( );
femp.setVisible( true );
}
}
class PanelConsultas extends JPanel implements ActionListener
{
private final static String CALCULAR_EDAD = "CALCULAR EDAD";
private final static String CALCULAR_ANTIGUEDAD = "CALCULAR ANTIGUEDAD";
private final static String CALCULAR_PRESTACIONES = "CALCULAR PRESTACIONES";
private JTextField txtEdad;
private JTextField txtAntiguedad;
private JTextField txtPrestaciones;
private JButton butEdad;
private JButton butAntiguedad;
private JButton butPrestaciones;
public PanelConsultas( )
{
GridBagLayout gridbag = new GridBagLayout( );
setLayout( gridbag );
setBorder( new CompoundBorder( new EmptyBorder( 0, 0, 5, 0 ), new TitledBorder( "Cálculos" ) )
);
butEdad = new JButton( );
GridBagConstraints gbc = new GridBagConstraints( 0, 0, 1, 1, 0, 0, GridBagConstraints.CENTER,
GridBagConstraints.BOTH, new
Insets( 5, 5, 5, 5 ), 0, 0 );
add( butEdad, gbc );
butAntiguedad = new JButton( );
gbc = new GridBagConstraints( 0, 1, 1, 1, 0, 0, GridBagConstraints.CENTER,
GridBagConstraints.BOTH, new Insets( 5, 5, 5,
5 ), 0, 0 );
add( butAntiguedad, gbc );
butPrestaciones = new JButton( );
gbc = new GridBagConstraints( 0, 2, 1, 1, 0, 0, GridBagConstraints.CENTER,
GridBagConstraints.BOTH, new Insets( 5, 5, 5,
5 ), 0, 0 );
add( butPrestaciones, gbc );
txtEdad = new JTextField( 10 );
gbc = new GridBagConstraints( 1, 0, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets( 5, 5, 5, 5
), 0, 0 );
add( txtEdad, gbc );
txtEdad.setEnabled( false );
txtAntiguedad = new JTextField( 10 );
gbc = new GridBagConstraints( 1, 1, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets( 5, 5, 5, 5
), 0, 0 );
add( txtAntiguedad, gbc );
txtAntiguedad.setEnabled( false );
txtPrestaciones = new JTextField( 10 );
gbc = new GridBagConstraints( 1, 2, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets( 5, 5, 5, 5
), 0, 0 );
add( txtPrestaciones, gbc );
txtPrestaciones.setEnabled( false );
butEdad.setText( "Calcular Edad" );
butEdad.setActionCommand( PanelConsultas.CALCULAR_EDAD );
butEdad.addActionListener( this);
butAntiguedad.setText( "Calcular Antigüedad" );
butAntiguedad.setActionCommand( PanelConsultas.CALCULAR_ANTIGUEDAD );
butPrestaciones.setText( "Calcular Prestaciones" );
butPrestaciones.setActionCommand( PanelConsultas.CALCULAR_PRESTACIONES );
}
public void actionPerformed( ActionEvent evento )
{
String cadena = "";
if ( evento.getSource().equals("Calcular Edad"))
cadena = "campoTexto1: " + evento.getActionCommand();
JOptionPane.showMessageDialog(null, cadena);
}
}
class PanelDatos extends JPanel
{
private JLabel labNombre;
private JLabel labApellido;
private JLabel labFIngreso;
private JLabel labFNacimiento;
private JLabel labSexo;
private JTextField txtNombre;
private JTextField txtApellido;
private JTextField txtFIngreso;
private JTextField txtFNacimiento;
private JTextField txtSexo;
private JLabel labImagen;
public PanelDatos( )
{
GridBagLayout gridbag = new GridBagLayout( );
setLayout( gridbag );
setBorder( new CompoundBorder( new EmptyBorder( 0, 0, 5, 0 ), new TitledBorder( "Datos
Personales" ) ) );
GridBagConstraints gbc;
labNombre = new JLabel( "Nombre: " );
gbc = new GridBagConstraints( 0, 0, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets( 5, 5, 5, 5
), 0, 0 );
add( labNombre, gbc );
labApellido = new JLabel( "Apellido: " );
gbc = new GridBagConstraints( 0, 1, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets( 5, 5, 5, 5
), 0, 0 );
add( labApellido, gbc );
labSexo = new JLabel( "Sexo: " );
gbc = new GridBagConstraints( 0, 2, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets( 5, 5, 5, 5
), 0, 0 );
add( labSexo, gbc );
labFNacimiento = new JLabel( "Fecha de Nacimiento: " );
gbc = new GridBagConstraints( 0, 3, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets( 5, 5, 5, 5
), 0, 0 );
add( labFNacimiento, gbc );
labFIngreso = new JLabel( "Fecha de Ingreso: " );
gbc = new GridBagConstraints( 0, 4, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets( 5, 5, 5, 5
), 0, 0 );
add( labFIngreso, gbc );
txtNombre = new JTextField( 15 );
gbc = new GridBagConstraints( 1, 0, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets( 5, 5, 5, 5
), 0, 0 );
add( txtNombre, gbc );
txtNombre.setEnabled( false );
txtApellido = new JTextField( 15 );
gbc = new GridBagConstraints( 1, 1, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets( 5, 5, 5, 5
), 0, 0 );
add( txtApellido, gbc );
txtApellido.setEnabled( false );
txtSexo = new JTextField( 2 );
gbc = new GridBagConstraints( 1, 2, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets( 5, 5, 5, 5
), 0, 0 );
add( txtSexo, gbc );
txtSexo.setEnabled( false );
txtFNacimiento = new JTextField( 10 );
gbc = new GridBagConstraints( 1, 3, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets( 5, 5, 5, 5
), 0, 0 );
add( txtFNacimiento, gbc );
txtFNacimiento.setEnabled( false );
txtFIngreso = new JTextField( 10 );
gbc = new GridBagConstraints( 1, 4, 1, 1, 0, 0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets( 5, 5, 5, 5
), 0, 0 );
add( txtFIngreso, gbc );
txtFIngreso.setEnabled( false );
labImagen = new JLabel( );
gbc = new GridBagConstraints( 2, 0, 1, 5, 1, 1, GridBagConstraints.CENTER,
GridBagConstraints.BOTH, new Insets( 5, 5, 5, 5 ),
0, 0 );
add( labImagen, gbc );
}
}
class PanelSalario extends JPanel
{
private final static String BUT_MODIFICAR_SALARIO = "MODIFICAR SALARIO";
private JLabel labSalario;
private JTextField txtSalario;
private JButton botonModificarSalario;
public PanelSalario( )
{
setLayout( new FlowLayout( ) );
labSalario = new JLabel( "Salario: " );
add( labSalario );
txtSalario = new JTextField( 10 );
add( txtSalario );
botonModificarSalario = new JButton( );
botonModificarSalario.setText( "Modificar" );
botonModificarSalario.setActionCommand( PanelSalario.BUT_MODIFICAR_SALARIO );
add( botonModificarSalario );
setBorder( new CompoundBorder( new EmptyBorder( 0, 0, 5, 0 ), new TitledBorder( "Salario" ) ) );
txtSalario.setEnabled( false );
}
}
class PanelExtensiones extends JPanel
{
private final String OPCION_1 = "opcion1";
private final String OPCION_2 = "opcion2";
private JButton butOpcion1;
private JButton butOpcion2;
public PanelExtensiones( )
{
setBorder( new CompoundBorder( new EmptyBorder( 0, 0, 5, 0 ), new TitledBorder( "Puntos de
Extensión" ) ) );
setLayout( new FlowLayout( ) );
butOpcion1 = new JButton( "Opción 1" );
butOpcion1.setActionCommand( OPCION_1 );
butOpcion2 = new JButton( "Opción 2" );
butOpcion2.setActionCommand( OPCION_2 );
add( butOpcion1 );
add( butOpcion2 );
}
}

Weitere ähnliche Inhalte

Was ist angesagt?

JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 Spring
Kiyotaka Oku
 

Was ist angesagt? (20)

The Ring programming language version 1.3 book - Part 51 of 88
The Ring programming language version 1.3 book - Part 51 of 88The Ring programming language version 1.3 book - Part 51 of 88
The Ring programming language version 1.3 book - Part 51 of 88
 
Ejemplo radio
Ejemplo radioEjemplo radio
Ejemplo radio
 
The Ring programming language version 1.10 book - Part 80 of 212
The Ring programming language version 1.10 book - Part 80 of 212The Ring programming language version 1.10 book - Part 80 of 212
The Ring programming language version 1.10 book - Part 80 of 212
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 Spring
 
Continuous Delivery A dramedy (with happy-end?) in 5 scenes
Continuous Delivery A dramedy (with happy-end?) in 5 scenesContinuous Delivery A dramedy (with happy-end?) in 5 scenes
Continuous Delivery A dramedy (with happy-end?) in 5 scenes
 
The Ring programming language version 1.5.1 book - Part 64 of 180
The Ring programming language version 1.5.1 book - Part 64 of 180The Ring programming language version 1.5.1 book - Part 64 of 180
The Ring programming language version 1.5.1 book - Part 64 of 180
 
Java practice programs for beginners
Java practice programs for beginnersJava practice programs for beginners
Java practice programs for beginners
 
The Ring programming language version 1.5.4 book - Part 61 of 185
The Ring programming language version 1.5.4 book - Part 61 of 185The Ring programming language version 1.5.4 book - Part 61 of 185
The Ring programming language version 1.5.4 book - Part 61 of 185
 
The Ring programming language version 1.5.1 book - Part 65 of 180
The Ring programming language version 1.5.1 book - Part 65 of 180The Ring programming language version 1.5.1 book - Part 65 of 180
The Ring programming language version 1.5.1 book - Part 65 of 180
 
The Ring programming language version 1.5.1 book - Part 79 of 180
The Ring programming language version 1.5.1 book - Part 79 of 180The Ring programming language version 1.5.1 book - Part 79 of 180
The Ring programming language version 1.5.1 book - Part 79 of 180
 
The Ring programming language version 1.6 book - Part 64 of 189
The Ring programming language version 1.6 book - Part 64 of 189The Ring programming language version 1.6 book - Part 64 of 189
The Ring programming language version 1.6 book - Part 64 of 189
 
Dagger & rxjava & retrofit
Dagger & rxjava & retrofitDagger & rxjava & retrofit
Dagger & rxjava & retrofit
 
Unittesting JavaScript with Evidence
Unittesting JavaScript with EvidenceUnittesting JavaScript with Evidence
Unittesting JavaScript with Evidence
 
Prog iv
Prog ivProg iv
Prog iv
 
The Ring programming language version 1.6 book - Part 71 of 189
The Ring programming language version 1.6 book - Part 71 of 189The Ring programming language version 1.6 book - Part 71 of 189
The Ring programming language version 1.6 book - Part 71 of 189
 
The Ring programming language version 1.7 book - Part 72 of 196
The Ring programming language version 1.7 book - Part 72 of 196The Ring programming language version 1.7 book - Part 72 of 196
The Ring programming language version 1.7 book - Part 72 of 196
 
The Ring programming language version 1.5.3 book - Part 71 of 184
The Ring programming language version 1.5.3 book - Part 71 of 184The Ring programming language version 1.5.3 book - Part 71 of 184
The Ring programming language version 1.5.3 book - Part 71 of 184
 
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGeneBang-Bang, you have been hacked - Yonatan Levin, KolGene
Bang-Bang, you have been hacked - Yonatan Levin, KolGene
 
The Ring programming language version 1.5.4 book - Part 68 of 185
The Ring programming language version 1.5.4 book - Part 68 of 185The Ring programming language version 1.5.4 book - Part 68 of 185
The Ring programming language version 1.5.4 book - Part 68 of 185
 
The Ring programming language version 1.8 book - Part 74 of 202
The Ring programming language version 1.8 book - Part 74 of 202The Ring programming language version 1.8 book - Part 74 of 202
The Ring programming language version 1.8 book - Part 74 of 202
 

Andere mochten auch (8)

Spreadly - The Social Sharing Ad-Network
Spreadly - The Social Sharing Ad-NetworkSpreadly - The Social Sharing Ad-Network
Spreadly - The Social Sharing Ad-Network
 
Pitch at EVM in Berlin
Pitch at EVM in BerlinPitch at EVM in Berlin
Pitch at EVM in Berlin
 
Encuesta
EncuestaEncuesta
Encuesta
 
Taller 4
Taller 4Taller 4
Taller 4
 
Πολυμεσα Αλεξια Β1
Πολυμεσα Αλεξια Β1Πολυμεσα Αλεξια Β1
Πολυμεσα Αλεξια Β1
 
Droger på internet 110222
Droger på internet 110222Droger på internet 110222
Droger på internet 110222
 
De Academie
De AcademieDe Academie
De Academie
 
Prima presentation
Prima presentationPrima presentation
Prima presentation
 

Ähnlich wie Taller 5

Tugas Praktikum Java 2
Tugas Praktikum Java 2Tugas Praktikum Java 2
Tugas Praktikum Java 2
azmi007
 
To change this template
To change this templateTo change this template
To change this template
kio1985
 
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdfimport java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
venkt12345
 
Registro de venta
Registro de ventaRegistro de venta
Registro de venta
lupe ga
 
Set up a JavaFX GUI-based program that shows a 10 times 10 grid of la.pdf
Set up a JavaFX GUI-based program that shows a 10 times 10 grid of la.pdfSet up a JavaFX GUI-based program that shows a 10 times 10 grid of la.pdf
Set up a JavaFX GUI-based program that shows a 10 times 10 grid of la.pdf
xlynettalampleyxc
 
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
AliHaiderCheema2
 

Ähnlich wie Taller 5 (20)

Tugas Praktikum Java 2
Tugas Praktikum Java 2Tugas Praktikum Java 2
Tugas Praktikum Java 2
 
To change this template
To change this templateTo change this template
To change this template
 
Easy Button
Easy ButtonEasy Button
Easy Button
 
Chap1 1 4
Chap1 1 4Chap1 1 4
Chap1 1 4
 
Chap1 1.4
Chap1 1.4Chap1 1.4
Chap1 1.4
 
Java
JavaJava
Java
 
Groovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonGroovy-er desktop applications with Griffon
Groovy-er desktop applications with Griffon
 
Groovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With GriffonGroovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With Griffon
 
Oop lecture9 10
Oop lecture9 10Oop lecture9 10
Oop lecture9 10
 
Guice2.0
Guice2.0Guice2.0
Guice2.0
 
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdfimport java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
 
culadora cientifica en java
culadora cientifica en javaculadora cientifica en java
culadora cientifica en java
 
Registro de venta
Registro de ventaRegistro de venta
Registro de venta
 
Set up a JavaFX GUI-based program that shows a 10 times 10 grid of la.pdf
Set up a JavaFX GUI-based program that shows a 10 times 10 grid of la.pdfSet up a JavaFX GUI-based program that shows a 10 times 10 grid of la.pdf
Set up a JavaFX GUI-based program that shows a 10 times 10 grid of la.pdf
 
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
 
TextSearch
TextSearchTextSearch
TextSearch
 
GoCracow #5 Bartlomiej klimczak - GoBDD
GoCracow #5 Bartlomiej klimczak - GoBDDGoCracow #5 Bartlomiej klimczak - GoBDD
GoCracow #5 Bartlomiej klimczak - GoBDD
 
XpUg Coding Dojo: KataYahtzee in Ocp way
XpUg Coding Dojo: KataYahtzee in Ocp wayXpUg Coding Dojo: KataYahtzee in Ocp way
XpUg Coding Dojo: KataYahtzee in Ocp way
 
The Ring programming language version 1.5.4 book - Part 60 of 185
The Ring programming language version 1.5.4 book - Part 60 of 185The Ring programming language version 1.5.4 book - Part 60 of 185
The Ring programming language version 1.5.4 book - Part 60 of 185
 
Griffon @ Svwjug
Griffon @ SvwjugGriffon @ Svwjug
Griffon @ Svwjug
 

Mehr von Řỉgö VẻGầ

Laboratorio 3 mascara de subred
Laboratorio 3 mascara de subredLaboratorio 3 mascara de subred
Laboratorio 3 mascara de subred
Řỉgö VẻGầ
 
Ventajas y desventajas de las redes sociales
Ventajas y desventajas de las redes socialesVentajas y desventajas de las redes sociales
Ventajas y desventajas de las redes sociales
Řỉgö VẻGầ
 
Ventajas y desventajas de las redes sociales
Ventajas y desventajas de las redes socialesVentajas y desventajas de las redes sociales
Ventajas y desventajas de las redes sociales
Řỉgö VẻGầ
 
Ventajas y desventajas de las redes sociales
Ventajas y desventajas de las redes socialesVentajas y desventajas de las redes sociales
Ventajas y desventajas de las redes sociales
Řỉgö VẻGầ
 

Mehr von Řỉgö VẻGầ (20)

Configuración servidores DCHP, DNS y HTTP - Cisco Packet Tracer
Configuración servidores DCHP, DNS y HTTP - Cisco Packet TracerConfiguración servidores DCHP, DNS y HTTP - Cisco Packet Tracer
Configuración servidores DCHP, DNS y HTTP - Cisco Packet Tracer
 
Pratica1
Pratica1Pratica1
Pratica1
 
Laboratorio 4 1 introping
Laboratorio 4 1 intropingLaboratorio 4 1 introping
Laboratorio 4 1 introping
 
Laboratorio 3 mascara de subred
Laboratorio 3 mascara de subredLaboratorio 3 mascara de subred
Laboratorio 3 mascara de subred
 
Taller 6
Taller 6Taller 6
Taller 6
 
Taller parcial
Taller parcialTaller parcial
Taller parcial
 
Taller interfaz 3
Taller interfaz 3Taller interfaz 3
Taller interfaz 3
 
Taller interfaz 2
Taller interfaz 2Taller interfaz 2
Taller interfaz 2
 
Interfaz Grafica En Java
Interfaz Grafica En JavaInterfaz Grafica En Java
Interfaz Grafica En Java
 
Taller de string(java)
Taller de string(java)Taller de string(java)
Taller de string(java)
 
Hechos en clase
Hechos en claseHechos en clase
Hechos en clase
 
Taller1
Taller1Taller1
Taller1
 
Taller Matrices En Java
Taller Matrices En JavaTaller Matrices En Java
Taller Matrices En Java
 
Historia de la computacion, tipos de lenguaje de programacion e historia
Historia de la computacion, tipos de lenguaje de programacion e historiaHistoria de la computacion, tipos de lenguaje de programacion e historia
Historia de la computacion, tipos de lenguaje de programacion e historia
 
Ventajas y desventajas de las redes sociales
Ventajas y desventajas de las redes socialesVentajas y desventajas de las redes sociales
Ventajas y desventajas de las redes sociales
 
Ventajas y desventajas de las redes sociales
Ventajas y desventajas de las redes socialesVentajas y desventajas de las redes sociales
Ventajas y desventajas de las redes sociales
 
Leyes
LeyesLeyes
Leyes
 
Como fabricar queso
Como fabricar quesoComo fabricar queso
Como fabricar queso
 
Ventajas y desventajas de las redes sociales
Ventajas y desventajas de las redes socialesVentajas y desventajas de las redes sociales
Ventajas y desventajas de las redes sociales
 
Leyes
LeyesLeyes
Leyes
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Taller 5

  • 1. import java.awt.BorderLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.*; import java.text.DecimalFormat; import java.text.NumberFormat; import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.*; import javax.swing.border.CompoundBorder; import javax.swing.border.EmptyBorder; import javax.swing.border.TitledBorder; public class InterfazEmpleado extends JFrame { private PanelDatos panelDatos; private PanelSalario panelSalario; private PanelConsultas panelConsultas; private PanelExtensiones panelExtensiones;
  • 2. public InterfazEmpleado( ) { setTitle( "Sistema de Empleados" ); JPanel panelCentral = new JPanel( ); panelDatos = new PanelDatos( ); panelSalario = new PanelSalario( ); panelConsultas = new PanelConsultas( ); panelExtensiones = new PanelExtensiones( ); getContentPane( ).add( panelDatos, BorderLayout.NORTH ); getContentPane( ).add( panelCentral, BorderLayout.CENTER ); getContentPane( ).add( panelExtensiones, BorderLayout.SOUTH ); panelCentral.setLayout( new BorderLayout( ) ); panelCentral.add( panelSalario, BorderLayout.NORTH ); panelCentral.add( panelConsultas, BorderLayout.CENTER ); setSize( 530, 530 ); setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); } public static void main( String[] args ) { InterfazEmpleado femp = new InterfazEmpleado( ); femp.setVisible( true ); } }
  • 3. class PanelConsultas extends JPanel implements ActionListener { private final static String CALCULAR_EDAD = "CALCULAR EDAD"; private final static String CALCULAR_ANTIGUEDAD = "CALCULAR ANTIGUEDAD"; private final static String CALCULAR_PRESTACIONES = "CALCULAR PRESTACIONES"; private JTextField txtEdad; private JTextField txtAntiguedad; private JTextField txtPrestaciones; private JButton butEdad; private JButton butAntiguedad; private JButton butPrestaciones; public PanelConsultas( ) { GridBagLayout gridbag = new GridBagLayout( ); setLayout( gridbag ); setBorder( new CompoundBorder( new EmptyBorder( 0, 0, 5, 0 ), new TitledBorder( "Cálculos" ) ) ); butEdad = new JButton( ); GridBagConstraints gbc = new GridBagConstraints( 0, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( butEdad, gbc ); butAntiguedad = new JButton( ); gbc = new GridBagConstraints( 0, 1, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets( 5, 5, 5,
  • 4. 5 ), 0, 0 ); add( butAntiguedad, gbc ); butPrestaciones = new JButton( ); gbc = new GridBagConstraints( 0, 2, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( butPrestaciones, gbc ); txtEdad = new JTextField( 10 ); gbc = new GridBagConstraints( 1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( txtEdad, gbc ); txtEdad.setEnabled( false ); txtAntiguedad = new JTextField( 10 ); gbc = new GridBagConstraints( 1, 1, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( txtAntiguedad, gbc ); txtAntiguedad.setEnabled( false ); txtPrestaciones = new JTextField( 10 ); gbc = new GridBagConstraints( 1, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( txtPrestaciones, gbc ); txtPrestaciones.setEnabled( false ); butEdad.setText( "Calcular Edad" ); butEdad.setActionCommand( PanelConsultas.CALCULAR_EDAD );
  • 5. butEdad.addActionListener( this); butAntiguedad.setText( "Calcular Antigüedad" ); butAntiguedad.setActionCommand( PanelConsultas.CALCULAR_ANTIGUEDAD ); butPrestaciones.setText( "Calcular Prestaciones" ); butPrestaciones.setActionCommand( PanelConsultas.CALCULAR_PRESTACIONES ); } public void actionPerformed( ActionEvent evento ) { String cadena = ""; if ( evento.getSource().equals("Calcular Edad")) cadena = "campoTexto1: " + evento.getActionCommand(); JOptionPane.showMessageDialog(null, cadena); } } class PanelDatos extends JPanel { private JLabel labNombre; private JLabel labApellido; private JLabel labFIngreso; private JLabel labFNacimiento; private JLabel labSexo; private JTextField txtNombre; private JTextField txtApellido; private JTextField txtFIngreso; private JTextField txtFNacimiento; private JTextField txtSexo;
  • 6. private JLabel labImagen; public PanelDatos( ) { GridBagLayout gridbag = new GridBagLayout( ); setLayout( gridbag ); setBorder( new CompoundBorder( new EmptyBorder( 0, 0, 5, 0 ), new TitledBorder( "Datos Personales" ) ) ); GridBagConstraints gbc; labNombre = new JLabel( "Nombre: " ); gbc = new GridBagConstraints( 0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( labNombre, gbc ); labApellido = new JLabel( "Apellido: " ); gbc = new GridBagConstraints( 0, 1, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( labApellido, gbc ); labSexo = new JLabel( "Sexo: " ); gbc = new GridBagConstraints( 0, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( labSexo, gbc ); labFNacimiento = new JLabel( "Fecha de Nacimiento: " );
  • 7. gbc = new GridBagConstraints( 0, 3, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( labFNacimiento, gbc ); labFIngreso = new JLabel( "Fecha de Ingreso: " ); gbc = new GridBagConstraints( 0, 4, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( labFIngreso, gbc ); txtNombre = new JTextField( 15 ); gbc = new GridBagConstraints( 1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( txtNombre, gbc ); txtNombre.setEnabled( false ); txtApellido = new JTextField( 15 ); gbc = new GridBagConstraints( 1, 1, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( txtApellido, gbc ); txtApellido.setEnabled( false ); txtSexo = new JTextField( 2 ); gbc = new GridBagConstraints( 1, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( txtSexo, gbc ); txtSexo.setEnabled( false );
  • 8. txtFNacimiento = new JTextField( 10 ); gbc = new GridBagConstraints( 1, 3, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( txtFNacimiento, gbc ); txtFNacimiento.setEnabled( false ); txtFIngreso = new JTextField( 10 ); gbc = new GridBagConstraints( 1, 4, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( txtFIngreso, gbc ); txtFIngreso.setEnabled( false ); labImagen = new JLabel( ); gbc = new GridBagConstraints( 2, 0, 1, 5, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets( 5, 5, 5, 5 ), 0, 0 ); add( labImagen, gbc ); } } class PanelSalario extends JPanel { private final static String BUT_MODIFICAR_SALARIO = "MODIFICAR SALARIO"; private JLabel labSalario; private JTextField txtSalario; private JButton botonModificarSalario;
  • 9. public PanelSalario( ) { setLayout( new FlowLayout( ) ); labSalario = new JLabel( "Salario: " ); add( labSalario ); txtSalario = new JTextField( 10 ); add( txtSalario ); botonModificarSalario = new JButton( ); botonModificarSalario.setText( "Modificar" ); botonModificarSalario.setActionCommand( PanelSalario.BUT_MODIFICAR_SALARIO ); add( botonModificarSalario ); setBorder( new CompoundBorder( new EmptyBorder( 0, 0, 5, 0 ), new TitledBorder( "Salario" ) ) ); txtSalario.setEnabled( false ); } } class PanelExtensiones extends JPanel { private final String OPCION_1 = "opcion1"; private final String OPCION_2 = "opcion2"; private JButton butOpcion1; private JButton butOpcion2; public PanelExtensiones( ) { setBorder( new CompoundBorder( new EmptyBorder( 0, 0, 5, 0 ), new TitledBorder( "Puntos de Extensión" ) ) );
  • 10. setLayout( new FlowLayout( ) ); butOpcion1 = new JButton( "Opción 1" ); butOpcion1.setActionCommand( OPCION_1 ); butOpcion2 = new JButton( "Opción 2" ); butOpcion2.setActionCommand( OPCION_2 ); add( butOpcion1 ); add( butOpcion2 ); } }