0% found this document useful (0 votes)
2 views1 page

Java Swing Form with Button Action

This Java code defines a Formulario class that extends JFrame and implements ActionListener. It contains a JButton called boton1 that displays a message dialog with the text "Happy child day" and title "Felicidades" when clicked. The main method creates an instance of Formulario, sets its bounds and title, sets it visible, and adds an action listener to the boton1 button to call the actionPerformed method when clicked.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Java Swing Form with Button Action

This Java code defines a Formulario class that extends JFrame and implements ActionListener. It contains a JButton called boton1 that displays a message dialog with the text "Happy child day" and title "Felicidades" when clicked. The main method creates an instance of Formulario, sets its bounds and title, sets it visible, and adds an action listener to the boton1 button to call the actionPerformed method when clicked.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

package juego;

import [Link].*;
import [Link].*;
public class Formulario extends JFrame implements ActionListener {
JButton boton1;
public Formulario() {
setLayout(null);
boton1=new JButton("Finalizar");
[Link](300,250,100,30);
add(boton1);
[Link](this);
}
@Override
public void actionPerformed(ActionEvent e) {
[Link](null, "Happy child
day","Felicidades",JOptionPane.INFORMATION_MESSAGE);
}
public static void main(String[] ar) {
Formulario formulario1=new Formulario();
[Link](0,0,450,350);
[Link](true);
[Link]("Botyon");
}

You might also like