....
> I am pretty new to Java and I am writing a simple chess applet.
Simple _and_ applet in the same sentence?
Applets are never simple, and not an ideal task for
someone 'pretty new to java'. They have complications
that go beyond anything you will experience with an
application.
e.g. Your Applet appears in Mozilla 1.3a, does not appear
in IE 6 (with Java 1.4.1 plug-in installed) and NN 4.78
asks for the 1.4 plug-in to be installed (as it should).
All tested under XP.
> 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.
Yes, quite. Even the Mozilla rendering was having
great difficulty. After a lot of clicking around, I _think_
I got one of the labels to (re)appear briefly.
> When I run the applet using Eclipse I can make the piece show up when
> I resize the applet with my mouse.
Ughhh... and learning Java using an advanced IDE.
Drop it and learn how to compile and run your
programs from the command line. You will need
the knowledge. Trust me.
> When I load the applet with a
> browser this does not work either.
<snip rest>
Somebody may already know (or guess) your
error, if they jump in, all well, but I think we
need to see your code.
I recommend you strip your code down
to the absolute minimum that displays the problem,
and post that here. It is also important to make
the code compileable and self contained.
--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Robert - 04 Dec 2003 21:14 GMT
I still don't think I should drop it. I belive the chess applet is a
very good task to acomplish when new to Java.
Andrew Thompson - 05 Dec 2003 04:38 GMT
> I still don't think I should drop it. I belive the chess applet is a
> very good task to acomplish when new to Java.
I assume you are referring to my comment that
Applets were not good for starters.
Let me clarify what I mean.
If I were developing this project, I would ensure
that the 'chessboard' was in a Panel that could be
dropped into either an Applet or Frame, but I would
_develop_ it as an application, and _only_ make it an
applet after I had the application version working.
Aplications are easier to debug and refresh than
Applets.
Please note, that even this 'seasoned hack'* in Java
would not approach the Applet _first_.
* Then there are the 'Gurus' - of which, I'm definitely
_not_ one.
So - I am not suggesting you drop the chess project,
but develop it as an application (or - best of all, a non-GUI
app) then, _then_ convert it to an applet.
Make sense?
--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site