I was Provided with a topic TicTacToe Game to be Prepared With in One Week by my University . I am a Beginner In this Programming Language
Actually I am Using An Array of Buttons and and also able to add button action Listener But Cannot able to perform function an a particular button
This is how I add Various Buttons In Panel having GridLayout
for(i=0;i<9;i++){
//Butto[i].setSize(70,70);
Butto[i]=new Button();
p1.add(Butto[i]);
Butto[i].addActionListener(this);
}
Now how to add a text on a particular Button When we click on it .
The actionPerformed Method Which i used is Given below
public void actionPerformed(ActionEvent e) {
Butto[i].setLabel(" X ");
}
Some Having Good Command on it Please help me How to add 'X' whenever i will click on the button
Thanx to all, for their Support, If Provided .
Have a nice Day .