More Related Content
PDF
DOCX
Semana 12 interfaces gráficas de usuario DOCX
Form Pemesanan Tiket dengan Java NetBeans PPTX
PPTX
PPTX
Reciclaje de materiles Informaticos PPTX
PDF
Viewers also liked
PPTX
PPTX
AUTOS HIBRIDOS TECNOLOGIA PARA EL FUTURO PPTX
PPTX
esta presentacion de Generadores eólicos espero que les guste ODP
Programación avanzada en Joomla! PPTX
PPS
La Tecnología en el Aprendizaje del Inglés PDF
Ingles principiantes-17901-completo PDF
PDF
Dates - ¿Cómo escribir las fechas en inglés? PPT
PPTX
PPT
Transporte y almacenamiento industrial del glp DOCX
PPTX
programacion orientada a objetos DOCX
Luz intermitente variable DOCX
PPT
Introducción a Programación Orientada a Objetos (OOP): Clases y Objetos DOCX
EJEMPLO APLICACIÓN DE MATRICES PPT
POO: Herencia, Abstraccion y Polimorfismo More from Esau Krruz
DOCX
DOCX
Contaminacion por-basura-en-veracruz (1) DOC
Documents.mx unidad 7-elaboracion-del-dti DOCX
Rúbrica trabajos escritos DOCX
Imagenes imprimir con buena calidad xD DOCX
DOCX
programa en Java
- 1.
import javax.swing.*;
import java.awt.event.*;
publicclass Ventana implements ActionListener{
private JFrame miVentanita;
private static final JLabel JLabel = null;
private static final boolean True = false;
private JLabel EtiquetaA;
private JLabel EtiquetaB;
private JTextField campoTextoA;
private JButton botonConvertir;
public Ventana (){
miVentanita=new JFrame();
EtiquetaA =new JLabel();
EtiquetaB =new JLabel ();
botonConvertir =new JButton ();
}
public void configurarComponentes (){
EtiquetaA.setText("Dame los Metros");
EtiquetaA.setBounds (10,10,100,50);
EtiquetaB.setText(" ?");
EtiquetaB.setBounds (10,50,100,50);
campoTextoA.setBounds (150,10,100,50);
botonConvertir.setText("Convetir");
botonConvertir.setBounds(10,200,50,100);
botonConvertir.addActionListener(this);
miVentanita.add(EtiquetaA);
miVentanita.add(EtiquetaB);
miVentanita.add(campoTextoA);
miVentanita.add(botonConvertir);
}
public void configurarVentana (){
miVentanita.setLayout(null);
miVentanita.setSize(400,400);
miVentanita.setLocation(300, 0);
miVentanita.setVisible(True);
}
- 2.
public void actionPerformed(ActionEventEvento) {
String dato;
int metros;
int centimetros;
if(Evento.getSource() == botonConvertir ){
dato=campoTextoA.getText();
metros= Integer.parseInt(dato);
centimetros = metros*100;
EtiquetaB.setText(Integer.toString(centimetros));
}}
}
public class Actividad30 {
public static void main (String [] args){
Ventana miVentanita=new Ventana();
miVentanita.configurarVentana();
miVentanita.configurarComponentes();
}
}