SlideShare a Scribd company logo
1 of 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 );
}
}

More Related Content

What's hot

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 88Mahmoud Samir Fayed
 
Ejemplo radio
Ejemplo radioEjemplo radio
Ejemplo radiolupe ga
 
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 212Mahmoud Samir Fayed
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 SpringKiyotaka Oku
 
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 scenesJörg Bächtiger
 
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 180Mahmoud Samir Fayed
 
Java practice programs for beginners
Java practice programs for beginnersJava practice programs for beginners
Java practice programs for beginnersishan0019
 
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 185Mahmoud Samir Fayed
 
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 180Mahmoud Samir Fayed
 
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 180Mahmoud Samir Fayed
 
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 189Mahmoud Samir Fayed
 
Dagger & rxjava & retrofit
Dagger & rxjava & retrofitDagger & rxjava & retrofit
Dagger & rxjava & retrofitTed Liang
 
Unittesting JavaScript with Evidence
Unittesting JavaScript with EvidenceUnittesting JavaScript with Evidence
Unittesting JavaScript with EvidenceTobie Langel
 
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 189Mahmoud Samir Fayed
 
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 196Mahmoud Samir Fayed
 
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 184Mahmoud Samir Fayed
 
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, KolGeneDroidConTLV
 
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 185Mahmoud Samir Fayed
 
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 202Mahmoud Samir Fayed
 

What's hot (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
 

Viewers also liked (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
 

Similar to Taller 5

Tugas Praktikum Java 2
Tugas Praktikum Java 2Tugas Praktikum Java 2
Tugas Praktikum Java 2azmi007
 
To change this template
To change this templateTo change this template
To change this templatekio1985
 
Groovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonGroovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonEric Wendelin
 
Groovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With GriffonGroovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With GriffonMatthew McCullough
 
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.pdfvenkt12345
 
Registro de venta
Registro de ventaRegistro de venta
Registro de ventalupe 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.pdfxlynettalampleyxc
 
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.docxAliHaiderCheema2
 
GoCracow #5 Bartlomiej klimczak - GoBDD
GoCracow #5 Bartlomiej klimczak - GoBDDGoCracow #5 Bartlomiej klimczak - GoBDD
GoCracow #5 Bartlomiej klimczak - GoBDDBartłomiej Kiełbasa
 
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 wayGiordano Scalzo
 
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 185Mahmoud Samir Fayed
 

Similar to 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
 

More from Řỉgö VẻGầ

More from Řỉ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
 

Recently uploaded

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 DiscoveryTrustArc
 
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...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
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 CVKhem
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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 Processorsdebabhi2
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
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 Takeoffsammart93
 
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 Subbuapidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
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 WorkerThousandEyes
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Recently uploaded (20)

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
 
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...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

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 ); } }