Reply To: Do you know the answer?

Home Forums General Chat Do you know the answer? Reply To: Do you know the answer?

#12485
David
Participant

:/

Fixed:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

class AnnonaLeetness extends JFrame {

JButton AnnonaOmg = new JButton(“Find out if Annona is LEET!”);
JTextField AnnonaPlz = new JTextField(30);

public AnnonaLeetness() {
super(“Is Annona leet?”);
setSize(350,100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
FlowLayout Annona = new FlowLayout();
setLayout(Annona);

add(AnnonaOmg);

AnnonaOmg.addActionListener(new AnnonaEvent());
setVisible(true);
}

class AnnonaEvent implements ActionListener {
public void actionPerformed(ActionEvent annonarocksmysocks) {
String Annona = “Mecha Tenchu”,
favorable = “Meepa Tenchu”,
Leetness = “Annona is a “;
if (Annona.equals(Leetness)) {
add(AnnonaPlz);
AnnonaPlz.setEnabled(false);
AnnonaPlz.setText(“Annona is a ” + Annona + “, thus, he is leet. Durr.”);
setVisible(true);
} else {
add(AnnonaPlz);
AnnonaPlz.setEnabled(false);
AnnonaPlz.setText(“Annona is a ” + favorable + “, thus, he is not leet. Durr.”);
setVisible(true);
}
}
}

public static void main(String[] args) {
AnnonaLeetness ANNONALOVESYOUALL = new AnnonaLeetness();
}
}