شباب انا مبتدى في الجافا وعندي خطأو ما عرفت اصححه تكفون ساعدوني
وهذ البرنامج
package aa;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class XO extends JFrame {
public JButton position[][];
private ButtonHandler b;
public XO() {
super("Tic Tac Toe Game");
Container boardPanel=getContentPane();
boardPanel.setLayout(new FlowLayout());
ButtonHandler handler=new ButtonHandler();
//create button
position=new JButton[9][9];
// int dim = 9 * 55;
boardPanel.setLayout(new GridLayout(9, 9));
for (int i = 0; i < 9; ++i)
{
for (int j = 0; j <9; ++j)
{
position[j] = new JButton("?");
position[j].addActionListener(handler);
boardPanel.add(position[j]);
// position[j].setEnabled(enabled);
}
}
setSize(300,300);
setVisible(true);
} //end constactor
public static void main(String args[])
{
XO ap= new XO();
ap.addWindowListener (
new WindowAdapter(){
public void windowClosing(WindowEvent e)
{System.exit (0); }
}
);
} //end main
private class ButtonHandler implements ActionListener{
public void actionP(ActionEvent e)
{
JOptionPane.showInternalMessageDialog(XO.this,"hello");
}
}
} //end of XO class