But I was struck and went through my own way. If you know tell me what is wrong with this code.
package math;
import javax.swing.*;
import java.awt.event.*;
public class test extends JFrame implements ActionListener{
public test(){
JFrame frame = new JFrame("Jesus");
JButton buttonOne = new JButton("St.Peter's");
JButton buttonTwo = new JButton("St.Anthony");
JButton buttonThree = new JButton("St.Sebastian");
frame.setVisible(true);
frame.setSize(400, 400);
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
buttonOne.addActionListener(this);
buttonTwo.addActionListener(this);
buttonThree.addActionListener(this);
frame.add(buttonOne);
frame.add(buttonTwo);
frame.add(buttonThree);
}
public void actionPerformed(ActionEvent e){
System.out.println("I love you, I don't let you down. I pray for you!");
}
public static void main(String args[]){
new test();
}
}


Sign In
Create Account


Back to top









