GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — TutorialesJava/tutoriales-codigo-java/FormularioEventos.java at master · jphber/TutorialesJava Expand file tree/ Copy pathFormularioEventos.javaMore file actions 46 lines (34 loc) · 1003 Bytes / Copy pathFormularioEventos.javaFile metadata and controls46 lines (34 loc) · 1003 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 package com.applikdos; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class FormularioEventos extends JFrame implements ActionListener { JButton boton1, boton2; public static void main(String[] args) { new FormularioEventos(); } public FormularioEventos() { setTitle("Formulario"); setSize(550, 250); setLayout(null); setVisible(true); boton1 = new JButton(); boton1.setText("Aceptar"); boton1.setBounds(150, 100, 100, 30); getContentPane().add(boton1); boton1.addActionListener(this); boton2 = new JButton(); boton2.setText("Cerrar"); boton2.setBounds(260, 100, 100, 30); getContentPane().add(boton2); boton2.addActionListener(this); } public void actionPerformed(ActionEvent evento){ if(evento.getSource()==boton1){ JOptionPane.showMessageDialog(null, "Este es el boton 1"); } if(evento.getSource()==boton2){ JOptionPane.showMessageDialog(null, "Este es el boton 2"); } } } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |