Jova wrote:
how do I get a tile on the player tray
I attached the WordPlayer class is this enough info.
How should I know? You don't provide an implementation for the Tray
object itself.
I'm guessing that what you need to know is that you can chain method
calls. I'm making some assumptions about the methods in the Tray class
here, but the code below is perfectly valid Java:
WordPlayer wp = new WordPlayer();
Tray tray = new Tray();
wp.setTray(tray);
// Here's the important part...
wp.getTray().addTile(someTileObj);
Note that calling a method that has a return type is the same in Java
as having an actual variable of that type available locally. The
compiler will see that "wp.getTray()" has a return value of type Tray,
thus you can use "wp.getTray()" anywhere where you'd use an object of
type Tray. This means that you can use it as the stem upon which you
call Tray object methods, as above (assuming the Tray object has an
object method called "addTile", of course.
Note that, depending on how you're designing your code, it might just
be better to add methods to WordPlayer for things like "addTile" and
"removeTile", which will in turn add or remove the tile from the tray
itself.
HTH!
Brad BARCLAY
--
=-=-=-=-=-=-=-=-=
From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
The jSyncManager Project:
http://www.jsyncmanager.org