I am trying to create a game called Ratsuk, it is like chess but only with knight knight ATM I have a problem in the movement of some time when I press a button other knight appears then it should not be (well I did not want to) I am quite sure that there is a problem with the action listener That in a short time the cabello once More but I just can not figure it out I'm quite desperate please help me I'm really new to Java.
Here is the part that I need help.
Public Zero Cabello (final integer row, final integer column) {last pocket current = mesa [row] [column]; Current.setIcon (image); Panel.repaint (); Assessment (row, column, current); } Public Zero Acciones (last int row, last int column, final JButton current) {for (int i = 0; i
< Code> Public Boolean tienebotton (int row, integer column) {return (line & gt; = & amp; amp; amp; amp; amp;; row & lt; HEIGHT & amp; amp; amp; column & gt; = 0 & amp; amp; amp; amp; amp; Columns & lt; WIDTH;}}
An improvement will be made for each subsequent if pre> if (tienebotton (line + 2, column + 1)) {...}
else if ... This will ensure that only one of them has been removed. / P>
No comments:
Post a Comment