hello! how are you?
i am writing for the game called"Mancala". i have found a lot of source codes already. but they don't really help me much. this is how it looks like.
your boxes=> b3 b2 b1
your score box | 3 | 3 | 3 | my score boc
0 | 3 | 3 | 3 | 0
b1 b2 b3 <== my boxes
there are 3 stones in each boxes except score boxes which only get added on..bottom boxes are mine and top boxes are yours. you just pick box and add to next boxes and set that box as empty.
your score box | 3 | 3 | 3 | my score boc
0 | 3 | 3 | 3 | 0
???
My question is how to use ActionEvent for JButtons.
i need to set a button clicked to zero and add 1 to next buttons, upto however stones were there in the button clicked on. add counterclockwise.if i click on box2 on bottom.
so it will be like this:
your score box | 3 | 3 | 4 | my score boc
0 | 3 | 0 | 4 | 1
you set number on button with JTextfield. but how do you know which button was clicked on since they are all same buttons with same text on them ,this case, number.
please help me. you get "ActionEvent e" and you have to use text comparsion to find the button. on my case they are all same number on them..so how to find which button i push and do calculations....
thanks very much...
i am writing for the game called"Mancala". i have found a lot of source codes already. but they don't really help me much. this is how it looks like.
your boxes=> b3 b2 b1
your score box | 3 | 3 | 3 | my score boc
0 | 3 | 3 | 3 | 0
b1 b2 b3 <== my boxes
there are 3 stones in each boxes except score boxes which only get added on..bottom boxes are mine and top boxes are yours. you just pick box and add to next boxes and set that box as empty.
your score box | 3 | 3 | 3 | my score boc
0 | 3 | 3 | 3 | 0
???
My question is how to use ActionEvent for JButtons.
i need to set a button clicked to zero and add 1 to next buttons, upto however stones were there in the button clicked on. add counterclockwise.if i click on box2 on bottom.
so it will be like this:
your score box | 3 | 3 | 4 | my score boc
0 | 3 | 0 | 4 | 1
you set number on button with JTextfield. but how do you know which button was clicked on since they are all same buttons with same text on them ,this case, number.
please help me. you get "ActionEvent e" and you have to use text comparsion to find the button. on my case they are all same number on them..so how to find which button i push and do calculations....
thanks very much...