Can you find the bug in this code?
Is there a problem, the way I created "showDialogBox()" method?Code:/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication61;
import javax.swing.*;
import java.awt.event.*;
public class ShowDialogBox {
JFrame frame;
public static void main(String[] args) {
ShowDialogBox db = new ShowDialogBox();
// TODO code application logic here
}
[B] public showDialogBox(){[/B]
frame = new JFrame("Show Her");
JButton button = new JButton("Click Me");
button.addActionListener(new MyAction());
frame.add(button);
frame.setSize(200,200);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
public class MyAction implements ActionListener{
public void actionPerformed(ActionEvent e){
JOptionPane.showMessageDialog(frame,"Leann is suckz!");
}
}
}

