R
Robert
Hi everyone,
I am pretty new to Java and I am writing a simple chess applet. My
chessboard is a gridlayout with panels. On those panels there are
labels which symbolize the chess pieces. When I click on a piece I can
then click on a second field of the chessboard and the piece (the
label) moves to it. For some reason it does not show up there though.
When I run the applet using Eclipse I can make the piece show up when
I resize the applet with my mouse. When I load the applet with a
browser this does not work either. It is strange to me that everyting
works fine when I move a piece to a field where there had been another
piece before. Not so, when I move the piece to a field, where there
has not been another piece before. I have tried several repaint
methods on it but it still has not worked. Please help me out on this.
You can try my applet at
http://mycgiserver.com/~schachserver/Schach/schachclient.html
Note that the labels are in German but this does not matter. Hit the
"Ziehen" button and you can then move the pieces. Click on a piece and
it will be highlighted. Then click on second field (no matter where as
long as there is no piece on it) and it will move there.
You can see what I mean if you move the piece in the upper left corner
to some field with no piece on it. It will not show up there. If you
then move the piece next to it (second colum, upper row) to the upper
left corner. This will show up there for some reason.
Please help.
I am pretty new to Java and I am writing a simple chess applet. My
chessboard is a gridlayout with panels. On those panels there are
labels which symbolize the chess pieces. When I click on a piece I can
then click on a second field of the chessboard and the piece (the
label) moves to it. For some reason it does not show up there though.
When I run the applet using Eclipse I can make the piece show up when
I resize the applet with my mouse. When I load the applet with a
browser this does not work either. It is strange to me that everyting
works fine when I move a piece to a field where there had been another
piece before. Not so, when I move the piece to a field, where there
has not been another piece before. I have tried several repaint
methods on it but it still has not worked. Please help me out on this.
You can try my applet at
http://mycgiserver.com/~schachserver/Schach/schachclient.html
Note that the labels are in German but this does not matter. Hit the
"Ziehen" button and you can then move the pieces. Click on a piece and
it will be highlighted. Then click on second field (no matter where as
long as there is no piece on it) and it will move there.
You can see what I mean if you move the piece in the upper left corner
to some field with no piece on it. It will not show up there. If you
then move the piece next to it (second colum, upper row) to the upper
left corner. This will show up there for some reason.
Please help.